MaxHalford / prince

:crown: Multivariate exploratory data analysis in Python — PCA, CA, MCA, MFA, FAMD, GPA
https://maxhalford.github.io/prince
MIT License
1.27k stars 184 forks source link

How does FAMD identify the principal components? #43

Closed weirdyang closed 5 years ago

weirdyang commented 5 years ago

Hi, How do I specify what are the principal components as shown in the MFAD? (e.g. principal component 1 is Oak type 1 and principal component 2 is Oak Type 2). For example, in the df below, I wish to set principal component 1 as "Donor is Teacher" == Yes and principal component 2 as "Donor is Teacher" == No. How do I specify that?

Thank you.

Donor State Donor Is Teacher Project Grade Level Category School Metro Type School State # Donations Received Teacher Project Posted Sequence Project Subject Category Tree Project Subject Subcategory Tree Project Resource Category Resource Vendor Name Amount Needed
Oklahoma No Grades 6-8 suburban Oklahoma 8 5 Math & Science Applied Sciences, Health & Life Science Supplies Carolina Biological Supply Company,Carolina Bi... 738.15
Oklahoma No Grades 9-12 suburban Oklahoma 6 2 Music & The Arts Visual Arts Supplies Amazon Business,Amazon Business 18.39
Maryland Yes Grades PreK-2 urban Maryland 5 20 Special Needs, Music & The Arts Special Needs, Visual Arts Supplies Amazon Business,Amazon Business,Amazon Busines... 10.59
Maryland Yes Grades PreK-2 urban Maryland 2 11 Applied Learning, Special Needs Early Development, Special Needs Books AKJ Education,AKJ Education,AKJ Education,AKJ ... 283.19
Massachusetts No Grades 3-5 urban Massachusetts 1 3 Health & Sports Health & Wellness, Team Sports Sports & Exercise Equipment School Specialty,Staples Advantage,School Spec... 322.88
MaxHalford commented 5 years ago

Hello,

I'm sorry but I don't understand the question... Principal components are vectors you after doing PCA/CA/MCA/FAMD. What exactly are you looking to do?

weirdyang commented 5 years ago

Hello,

I'm sorry but I don't understand the question... Principal components are vectors you after doing PCA/CA/MCA/FAMD. What exactly are you looking to do?

In the example you provided in the readme, it mentions the following:

The first component is interpreted as the opposition between the first(wines 1, 5, and 6) and the second oak type (wines 2, 3, and 4).

edit; I realised I misunderstood this. My bad. So sorry for the trouble!

MaxHalford commented 5 years ago

Cool! I'll let you close this issue if you don't have any more questions :). I might take a look at the README to see if things could be any clearer.