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

Two runs by MAGIC #189

Open
GeniusYx opened this issue Oct 23, 2020 · 1 comment
Open

Two runs by MAGIC #189

GeniusYx opened this issue Oct 23, 2020 · 1 comment
Labels

Comments

@GeniusYx
Copy link

Dear authors:
Thank you for your contribution.

I have a problem with algorithm robustness. When I use the same dataset and run the algorithm twice to impute the data, can I get the completely same result twice?

Thank you.
Look forward to your reply.

@scottgigante
Copy link
Contributor

@GeniusYx the results should be almost identical from run to run -- the only difference is in the computation of randomized PCA. However, to get the same result every time, you can set the seed with random_state.

import numpy as np
import magic

X = np.random.poisson(0.2, (5000, 1000))
X_magic1 = magic.MAGIC(random_state=42).fit_transform(X)
X_magic2 = magic.MAGIC(random_state=42).fit_transform(X)

np.testing.assert_equal(X_magic1, X_magic2)

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

No branches or pull requests

2 participants