smile.imputation
Class SVDImputation
- java.lang.Object
-
- smile.imputation.SVDImputation
-
- All Implemented Interfaces:
- MissingValueImputation
public class SVDImputation extends java.lang.Object implements MissingValueImputation
Missing value imputation with singular value decomposition. Given SVD A = U Σ VT, we use the most significant eigenvectors of VT to linearly estimate missing values. Although it has been shown that several significant eigenvectors are sufficient to describe the data with small errors, the exact fraction of eigenvectors best for estimation needs to be determined empirically. Once k most significant eigenvectors from VT are selected, we estimate a missing value j in row i by first regressing this row against the k eigenvectors and then use the coefficients of the regression to reconstruct j from a linear combination of the k eigenvectors. The j th value of row i and the j th values of the k eigenvectors are not used in determining these regression coefficients. It should be noted that SVD can only be performed on complete matrices; therefore we originally fill all missing values by other methods in matrix A, obtaining A'. We then utilize an expectation maximization method to arrive at the final estimate, as follows. Each missing value in A is estimated using the above algorithm, and then the procedure is repeated on the newly obtained matrix, until the total change in the matrix falls below the empirically determined threshold (say 0.01).
-
-
Constructor Summary
Constructors Constructor and Description SVDImputation(int k)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidimpute(double[][] data)Impute missing values in the dataset.voidimpute(double[][] data, int maxIter)Impute missing values in the dataset.
-
-
-
Constructor Detail
-
SVDImputation
public SVDImputation(int k)
Constructor.- Parameters:
k- the number of eigenvectors used for imputation.
-
-
Method Detail
-
impute
public void impute(double[][] data) throws MissingValueImputationExceptionDescription copied from interface:MissingValueImputationImpute missing values in the dataset.- Specified by:
imputein interfaceMissingValueImputation- Parameters:
data- a data set with missing values (represented as Double.NaN). On output, missing values are filled with estimated values.- Throws:
MissingValueImputationException
-
impute
public void impute(double[][] data, int maxIter) throws MissingValueImputationExceptionImpute missing values in the dataset.- Parameters:
data- a data set with missing values (represented as Double.NaN). On output, missing values are filled with estimated values.maxIter- the maximum number of iterations.- Throws:
MissingValueImputationException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG