supplementary / illustrative variables implemented? #183
-
I was wondering whether supplementary variables are implemented (corresponding to Also: I really appreciate your efforts with this - great initiative, great package, great name! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
Hey there @mluerig! I appreciate the kind words. Yes, Prince supports supplementary variables: import prince
dataset = prince.datasets.load_energy_mix(year=2019, normalize=True)
pca = prince.PCA()
pca.fit(dataset, supplementary_columns=['hydro', 'wind', 'solar'])
pca.column_correlations This is unit tested against FactoMineR, and should provide exactly the same results 👌 |
Beta Was this translation helpful? Give feedback.
-
too bad. probably not high on your priority list, but looking at the code for PCA and seeing how MFA is implemented it might not be too hard to implement supporting variables there as well? let me know if you have any plans to do so, otherwise I could give it a shot sometime next year... |
Beta Was this translation helpful? Give feedback.
-
@mluerig I just released v0.15. I completely revamped MFA: it now properly inherits from PCA, and thus has all the latter's methods. Supplementary rows and supplementary groups are now supported. Please let me know if you're looking for anything particular! I can strike the iron while it's hot. Also, if I may ask, what are you using MFA for? |
Beta Was this translation helpful? Give feedback.
-
so cool, thanks! will try to take a look in the next few days. I think supp. cols and rows were mostly what I was missing I have been using MFA to analyze large datasets of phenotypic traits from various organisms, where the grouping either consituted different types of traits (shape vs color), or different parts of an organism (dorsum vs ventrum, thorax vs abdomen in insects). MFA seemed like a great way to construct such morphospaces (https://doi.org/10.1016/j.cub.2021.08.040) that account for group differences yet keep them comparable, because all subspaces are rotated in the same direction |
Beta Was this translation helpful? Give feedback.
-
thanks for the information! |
Beta Was this translation helpful? Give feedback.
Ah indeed, Prince does not yet support supplementary variables for MFA :/