Commit 74db352e authored by Martino Bertoni's avatar Martino Bertoni 🌋
Browse files

removed dependency that was merged to sklearn

parent 5299c569
Pipeline #2492 failed with stages
in 36 minutes and 18 seconds
......@@ -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):
try:
from fancyimpute import IterativeImputer as fancyImputer
except ImportError:
raise ImportError("requires fancyimpute " +
"https://github.com/iskandr/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()
fancy.fit(M)
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