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

missing data imputation #3

Open
shyamkkhadka opened this issue Feb 16, 2017 · 1 comment
Open

missing data imputation #3

shyamkkhadka opened this issue Feb 16, 2017 · 1 comment

Comments

@shyamkkhadka
Copy link

Hi, Can you please tell me how can I use for missing data imputation for this program ? It is written as

Missing data is simply the limit of weight=0.

But I am not getting where to set weight = 0. When I did
m0 = empca(noisy_data, weights = 0, niter=20)
it gives error as

File "empca.py", line 290, in empca
assert data.shape == weights.shape

Can you please help me ? I want to use your code for imputation problem. Thank you.

@sbailey
Copy link
Owner

sbailey commented Feb 21, 2017

weights and data should both be arrays with shape (num_observations, num_variables). weights[i,j] indicates what weight should be applied to data[i,j] when calculating the PCA. If observation i variable j is missing, then set weights[i,j] = 0 and data[i,j] will be ignored. For each variable j, there must be some observations i that have a non-zero weight.

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