jwzimmer-zz / tv-tropening

1 stars 0 forks source link

Transposing the matrix - 237 traits x 800 characters instead of 800 characters x 237 traits #17

Closed jwzimmer-zz closed 2 years ago

jwzimmer-zz commented 2 years ago

It's possible there's a mistake in here somewhere, I did this re-using code I had already made, I don't think there's any reason that was a bad idea but just mentioning that (I was thinking of the matrix as having the other orientation when I wrote the code, so maybe I encoded that assumption unintentionally somewhere)...

================== First column of U looks like our typical first row of V^T (in the usual matrix orientation) image

Second column of U looks like our typical first row of V^T image

I'm going to assume the rest look the same as well.

To re-run:

dfint = df2.transpose()
df2t, u2t, d2t, v2t, sig2t, x2t, rex2t = runSVD(dfint,dropcols=[])
vector_barchart(col2, u2t.transpose()[0,:], 10)

================== First row of V^T image

Second row of V^T image

Third row of V^T image

Fourth row of V^T image

Fifth row of V^T image

Sixth row of V^T image

Seventh row of V^T image

Eighth row of V^T image

Ninth row of V^T image

Tenth row of V^T image

To re-run:

character_list = [x for x in character_map["Character display name"]]
vector_barchart(character_list, v2t[0,:], 10)

================================ Note that vector_barchart(character_list, U2.transpose()[0,:], 10) is the same as vector_barchart(character_list, v2t[0,:], 10)... The columns of our usual U are the same as the rows of V^T if we transpose the matrix.

jwzimmer-zz commented 2 years ago
Screen Shot 2021-10-25 at 1 06 03 PM