EmpezarEmpieza gratis

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

Ver curso

Instrucciones del ejercicio

  • Echa un vistazo a la matriz G usando el comando print
  • Revisa las matrices H, I y J y determina qué par de esas matrices producirá G al 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)
Editar y ejecutar código