Commit 28f6c832 authored by Martina Locatelli's avatar Martina Locatelli 🍁
Browse files
parents d2ec7625 74db352e
......@@ -121,7 +121,6 @@ faiss.Kmeans(10, 20).train(numpy.random.rand(1000, 10).astype(numpy.float32))"'
pip install openpyxl # open xlsx
pip install scipy # scientific python
pip install theano # Optimize evaluate math expressions
pip install fancyimpute==0.5.4 # matrix completion and imputation algorithms
pip install protobuf # Google serialization library
pip install statsmodels # many different statistical models and tests
......@@ -5,6 +5,8 @@ import numpy as np
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import RobustScaler
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer
perc = 99.9
......@@ -21,12 +23,6 @@ def deextremize(X, z_extreme, up=None, dw=None):
def gaussian_scale_impute(X, z_extreme=10, models_path=None, up=None, dw=None):
from fancyimpute import IterativeImputer as fancyImputer
except ImportError:
raise ImportError("requires fancyimpute " +
imputer_file = "imput.pcl"
scaler_file = "scale.pcl"
fancy_file = "fancy.pcl"
......@@ -62,7 +58,7 @@ def gaussian_scale_impute(X, z_extreme=10, models_path=None, up=None, dw=None):
M, up, dw = deextremize(M, z_extreme, up, dw)
M[np.isnan(X)] = np.nan
if fancy_file is None or not os.path.exists(fancy_file):
fancy = fancyImputer()
fancy = IterativeImputer()
with open(fancy_file, 'wb') as fh:
pickle.dump(fancy, fh)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment