Factorización de matrices
La matriz G se proporciona aquí como un dataframe de Pandas. Mírala para entender su estructura. Revisa las posibles matrices factor H, I y J (también dataframes de Pandas) y determina qué dos matrices producen la matriz G al multiplicarlas.
Este ejercicio forma parte del curso
Creación de motores de recomendación con PySpark
Instrucciones del ejercicio
- Echa un vistazo a la matriz
Gusando el comandoprint - Revisa las matrices
H,IyJy determina qué par de esas matrices produciráGal multiplicarlas. - Introduce tu respuesta en el código
np.matmul()proporcionado.
ejercicio interactivo práctico
Prueba este ejercicio completando este código de ejemplo.
# 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)