Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functionality of fs_r_sup() #21

Open
mpikoula opened this issue Dec 19, 2021 · 1 comment
Open

Functionality of fs_r_sup() #21

mpikoula opened this issue Dec 19, 2021 · 1 comment

Comments

@mpikoula
Copy link

Hello and many thanks for this module!

I'd like to get the MCA components on new, unseen data (test set) and was going to use fs_r_sup() to do so. In order to verify that I would get something reasonable I tried running fs_r_sup() on the training set, expecting to get the same result as fs_r().

However, the result is in fact a scaled version of fs_r() - each column is multiplied by a factor and I can't figure out where it comes from or whether I should be expecting this. I reproduce this in your burgundies notebook example where X the original data matrix:

Input:
mca_ben.fs_r(N=3)

Output
array([[ 0.8617, 0.0786, -0.0213],
[-0.7130, -0.1571, -0.0192],
[-0.9221, 0.0786, -0.0051],
[-0.8617, 0.0786, 0.0213],
[ 0.9221, 0.0786, 0.0051],
[ 0.7130, -0.1571, 0.0192]])

Input:
mca_ben.fs_r_sup(X,N=3)

Output:
array([[ 0.9510, 0.3162, -0.4301],
[-0.7870, -0.6325, -0.3871],
[-1.0177, 0.3162, -0.1026],
[-0.9510, 0.3162, 0.4301],
[ 1.0177, 0.3162, 0.1026],
[ 0.7870, -0.6325, 0.3871]])

Equivalent to:

Input:
mca_ind.fs_r_sup(X,N=3)

Output:
array([[ 0.9510, 0.3162, -0.4301],
[-0.7870, -0.6325, -0.3871],
[-1.0177, 0.3162, -0.1026],
[-0.9510, 0.3162, 0.4301],
[ 1.0177, 0.3162, 0.1026],
[ 0.7870, -0.6325, 0.3871]])

Any help appreciated!

@esafak
Copy link
Owner

esafak commented Feb 13, 2022

Hello, Maria. Were you able to resolve this? I don't have time to look into it so if you know what went wrong and can suggest a fix, I would be glad to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants