juanshishido / okcupid

Analyzing online self-presentation
MIT License
5 stars 0 forks source link

pca with varimax rotation #5

Open matarhaller opened 8 years ago

matarhaller commented 8 years ago

doesn't seem to be implemented in python.

matarhaller commented 8 years ago

I'm trying to implement R in python using rpy2, but there is also this which seems to maybe be an implementation of varimax rotation https://github.com/rossfadely/consomme/blob/master/consomme/rotate_factor.py

matarhaller commented 8 years ago

running it using rpy2 is super duper slow. going to try this: http://stackoverflow.com/questions/17628589/perform-varimax-rotation-in-python-using-numpy

juanshishido commented 8 years ago

Did rotate_factor.py not work well?

Sweet re the SO implementation using NumPy. Good luck!

matarhaller commented 8 years ago

Good point. I was thinking about that, but thought we'd start simple for now. On Nov 24, 2015 2:14 AM, "Juan Shishido" notifications@github.com wrote:

Just wanted to mention that we could also consider nonlinear dimensionality reduction techniques, such as Kernel PCA. I don't know whether our features are linearly separable, so thought I'd bring this up.

— Reply to this email directly or view it on GitHub https://github.com/juanshishido/okcupid/issues/5#issuecomment-159217874.

juanshishido commented 8 years ago

I read some more after posting that and found out that text is usually linearly separable, which is why I deleted my comment :sweat_smile:

matarhaller commented 8 years ago

rotate_factor.py only works on a square matrix.

jnaras commented 8 years ago

Mmmm. Can we try it in R?

matarhaller commented 8 years ago

I tried it and it seemed like it didn't like the zeros in the matrix. I'm not familiar enough with rotation to know if that's the true issue though. On Nov 25, 2015 9:20 AM, "Jaya Narasimhan" notifications@github.com wrote:

Mmmm. Can we try it in R?

— Reply to this email directly or view it on GitHub https://github.com/juanshishido/okcupid/issues/5#issuecomment-159678848.

jnaras commented 8 years ago

Okay, I'll try to write it out in matrix form then and plug it into your PCA code!