Skip to content

Python implementation of Mazumder and Hastie's softImpute for matrix completion

Notifications You must be signed in to change notification settings

travisbrady/py-soft-impute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

py-soft-impute

Python implementation of Mazumder and Hastie's R softImpute package.

This code provides an experimental sklearn-ish class for missing data imputation. The code is currently more or less a literal translation from the original R package's simpute.als function. I'm planning on also implementing simpute.svd. Hastie and Mazumder experiment with this approach on the Netflix problem.

Notes:

Toy example usage

 import numpy as np
 from soft_impute import SoftImpute

 X = np.arange(50).reshape(10, 5) * 1.0

 # Change 10 to nan aka missing
 X[2, 0] = np.nan
 clf.fit(X)
 imputed = clf.transform(X)

 # Should be 10
 print imputed[2, 0]
 10.01385116

About

Python implementation of Mazumder and Hastie's softImpute for matrix completion

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages