Matrixfaktorisierung
Die Matrix G ist hier als Pandas-DataFrame gegeben. Schau sie dir an, um zu verstehen, wie sie aussieht. Betrachte die möglichen Faktor-Matrizen H, I und J (ebenfalls Pandas-DataFrames) und bestimme, welche zwei Matrizen bei der Multiplikation die Matrix G ergeben.
Diese Übung ist Teil des Kurses
<Kurs>Recommendation Engines mit PySpark erstellen</Kurs>Übungsanweisungen
- Sieh dir die Matrix
Gmit dem Befehlprintan. - Sieh dir die Matrizen
H,IundJan und entscheide, welches Paar dieser Matrizen bei der MultiplikationGergibt. - Gib deine Antwort in den bereitgestellten
np.matmul()-Code ein.
Interaktive praktische Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# 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)