empca icon indicating copy to clipboard operation
empca copied to clipboard

missing data imputation

Open shyamkkhadka opened this issue 8 years ago • 1 comments

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.

shyamkkhadka avatar Feb 16 '17 10:02 shyamkkhadka

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.

sbailey avatar Feb 21 '17 23:02 sbailey