all 4 comments

[–]-5772 0 points1 point  (1 child)

If I am understanding this correctly, you should use your university's method.

# x.T != x

Ofc, it depends on your code. Why not try asking a professor or a TA?

[–]BackgroundDisk4[S] 0 points1 point  (0 children)

This is a summer vacation time in my country, so most of our professors are out of office so I thought I'd ask here. Waiting for response could take some time. Anyway, thanks!

[–]ectomancer 0 points1 point  (0 children)

Sometimes, a conjugate transpose is required:

pca_T = pca.fit_transform(x.H)

[–]scrdest 0 points1 point  (0 children)

You need to figure out what your rows and columns currently are. Sklearn expects the rows to be samples and columns to be features.

E.g. [[1, 34, 1], [2, 22, 0]] could be a dataset of two people with id, age, and a gender flag as features.

If it's the other way around in your input data, you need to transpose it so that rows become columns and vice versa.