행렬 분해
행렬 G가 Pandas 데이터프레임으로 제공됩니다. 먼저 확인해 형태를 파악하세요. 가능한 분해 행렬 H, I, J(모두 Pandas 데이터프레임)도 살펴보고, 어떤 두 행렬을 곱하면 G가 되는지 판단해 보세요.
이 연습은 강의의 일부입니다
PySpark로 추천 엔진 만들기
연습 안내
print명령으로 행렬G를 확인하세요.- 행렬
H,I,J를 살펴보고, 이 중 어떤 두 행렬을 곱하면G가 되는지 결정하세요. - 제공된
np.matmul()코드에 정답을 입력하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Take a look at Matrix G using the following print function
print("Matrix G:")
print(____)
# Take a look at the matrices H, I, and J and determine which pair of those matrices will produce G when multiplied together.
print("Matrix H:")
print(____)
print("Matrix I:")
print(____)
print("Matrix J:")
print(____)
# Multiply the two matrices that are factors of the matrix G
prod = np.matmul(____, ____)
print(G == prod)