Multivariate imputation and matrix completion algorithms implemented in Python

Overview

Build Status Coverage Status DOI

plot

A variety of matrix completion and imputation algorithms implemented in Python 3.6.

To install:

pip install fancyimpute

Do not use conda. We don't support it.

Important Caveats

(1) This project is in "bare maintenance" mode. That means we are not planning on adding more imputation algorithms or features (but might if we get inspired). Please do report bugs, and we'll try to fix them. Also, we are happy to take pull requests for more algorithms and/or features.

(2) IterativeImputer started its life as a fancyimpute original, but was then merged into scikit-learn and we deleted it from fancyimpute in favor of the better-tested sklearn version. As a convenience, you can still from fancyimpute import IterativeImputer, but under the hood it's just doing from sklearn.impute import IterativeImputer. That means if you update scikit-learn in the future, you may also change the behavior of IterativeImputer.

Usage

from fancyimpute import KNN, NuclearNormMinimization, SoftImpute, BiScaler

# X is the complete data matrix
# X_incomplete has the same values as X except a subset have been replace with NaN

# Use 3 nearest rows which have a feature to fill in each row's missing features
X_filled_knn = KNN(k=3).fit_transform(X_incomplete)

# matrix completion using convex optimization to find low-rank solution
# that still matches observed values. Slow!
X_filled_nnm = NuclearNormMinimization().fit_transform(X_incomplete)

# Instead of solving the nuclear norm objective directly, instead
# induce sparsity using singular value thresholding
X_incomplete_normalized = BiScaler().fit_transform(X_incomplete)
X_filled_softimpute = SoftImpute().fit_transform(X_incomplete_normalized)

# print mean squared error for the  imputation methods above
nnm_mse = ((X_filled_nnm[missing_mask] - X[missing_mask]) ** 2).mean()
print("Nuclear norm minimization MSE: %f" % nnm_mse)

softImpute_mse = ((X_filled_softimpute[missing_mask] - X[missing_mask]) ** 2).mean()
print("SoftImpute MSE: %f" % softImpute_mse)

knn_mse = ((X_filled_knn[missing_mask] - X[missing_mask]) ** 2).mean()
print("knnImpute MSE: %f" % knn_mse)

Algorithms

  • SimpleFill: Replaces missing entries with the mean or median of each column.

  • KNN: Nearest neighbor imputations which weights samples using the mean squared difference on features for which two rows both have observed data.

  • SoftImpute: Matrix completion by iterative soft thresholding of SVD decompositions. Inspired by the softImpute package for R, which is based on Spectral Regularization Algorithms for Learning Large Incomplete Matrices by Mazumder et. al.

  • IterativeImputer: A strategy for imputing missing values by modeling each feature with missing values as a function of other features in a round-robin fashion. A stub that links to scikit-learn's IterativeImputer.

  • IterativeSVD: Matrix completion by iterative low-rank SVD decomposition. Should be similar to SVDimpute from Missing value estimation methods for DNA microarrays by Troyanskaya et. al.

  • MatrixFactorization: Direct factorization of the incomplete matrix into low-rank U and V, with an L1 sparsity penalty on the elements of U and an L2 penalty on the elements of V. Solved by gradient descent.

  • NuclearNormMinimization: Simple implementation of Exact Matrix Completion via Convex Optimization by Emmanuel Candes and Benjamin Recht using cvxpy. Too slow for large matrices.

  • BiScaler: Iterative estimation of row/column means and standard deviations to get doubly normalized matrix. Not guaranteed to converge but works well in practice. Taken from Matrix Completion and Low-Rank SVD via Fast Alternating Least Squares.

Citation

If you use fancyimpute in your academic publication, please cite it as follows:

@software{fancyimpute,
  author = {Alex Rubinsteyn and Sergey Feldman},
  title={fancyimpute: An Imputation Library for Python},
  url = {https://github.com/iskandr/fancyimpute},
  version = {0.5.4},
  date = {2016},
}
Comments
  • Hey guys! I would like to contribute this program

    Hey guys! I would like to contribute this program

    This project is so interesting!!!

    Added missForest, a widely used imputation method. I have been tested this update, including using setup.py! Thanks a lot!

    I am doing some research on data completion, I have found some more advanced methods, I look forward to joining you

    I am the author of ycimpute and I would like to join you! I will follow the coding style of the project

    opened by HCMY 13
  • IterativeImputer: Input contains NaN, infinity or a value too large for dtype('float64').

    IterativeImputer: Input contains NaN, infinity or a value too large for dtype('float64').

    Not having this issue trying to impute the same dataset with KNN.

    ValueError Traceback (most recent call last) in 1 #KNN(k=3).fit_transform(training_nan) ----> 2 IterativeImputer().fit_transform(training_nan)

    ~\Anaconda3\lib\site-packages\fancyimpute\iterative_imputer.py in fit_transform(self, X, y) 936 Xt, predictor = self._impute_one_feature( 937 Xt, mask_missing_values, feat_idx, neighbor_feat_idx, --> 938 predictor=None, fit_mode=True) 939 predictor_triplet = ImputerTriplet(feat_idx, 940 neighbor_feat_idx,

    ~\Anaconda3\lib\site-packages\fancyimpute\iterative_imputer.py in _impute_one_feature(self, X_filled, mask_missing_values, feat_idx, neighbor_feat_idx, predictor, fit_mode) 674 y_train = safe_indexing(X_filled[:, feat_idx], 675 ~missing_row_mask) --> 676 predictor.fit(X_train, y_train) 677 678 # get posterior samples

    ~\Anaconda3\lib\site-packages\sklearn\linear_model\ridge.py in fit(self, X, y, sample_weight) 1146 gcv_mode=self.gcv_mode, 1147 store_cv_values=self.store_cv_values) -> 1148 estimator.fit(X, y, sample_weight=sample_weight) 1149 self.alpha_ = estimator.alpha_ 1150 if self.store_cv_values:

    ~\Anaconda3\lib\site-packages\sklearn\linear_model\ridge.py in fit(self, X, y, sample_weight) 1016 """ 1017 X, y = check_X_y(X, y, ['csr', 'csc', 'coo'], dtype=np.float64, -> 1018 multi_output=True, y_numeric=True) 1019 if sample_weight is not None and not isinstance(sample_weight, float): 1020 sample_weight = check_array(sample_weight, ensure_2d=False)

    ~\Anaconda3\lib\site-packages\sklearn\utils\validation.py in check_X_y(X, y, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, multi_output, ensure_min_samples, ensure_min_features, y_numeric, warn_on_dtype, estimator) 754 ensure_min_features=ensure_min_features, 755 warn_on_dtype=warn_on_dtype, --> 756 estimator=estimator) 757 if multi_output: 758 y = check_array(y, 'csr', force_all_finite=True, ensure_2d=False,

    ~\Anaconda3\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, warn_on_dtype, estimator) 571 if force_all_finite: 572 _assert_all_finite(array, --> 573 allow_nan=force_all_finite == 'allow-nan') 574 575 shape_repr = _shape_repr(array.shape)

    ~\Anaconda3\lib\site-packages\sklearn\utils\validation.py in _assert_all_finite(X, allow_nan) 54 not allow_nan and not np.isfinite(X).all()): 55 type_err = 'infinity' if allow_nan else 'NaN, infinity' ---> 56 raise ValueError(msg_err.format(type_err, X.dtype)) 57 58

    opened by joshuakoh1 13
  • Applying to new data

    Applying to new data

    Is there a way to apply an imputation model to new data without reestimating the model?

    In a supervised setting you don't want to retrain your whole model every time you see a new test instance.

    Thanks.

    opened by amueller 12
  • Solver 'SCS' failed when there is solver SCS in the cvxpy package.

    Solver 'SCS' failed when there is solver SCS in the cvxpy package.

    machine: windows 10 python evn ; anaconda 5.4/ python 3.6 pip install fancyimpute conda install cvxpy

    It keeps saying that SolverError: Solver 'SCS' failed. Try another solver or solve with verbose=True for more information. Try recentering the problem data around 0 and rescaling to reduce the dynamic range.

    INSTALLED_SOLVERS
    ['ECOS', 'ECOS_BB', 'SCS', 'OSQP']
    
    mat_restored = NuclearNormMinimization().fit_transform(mat_destroyed)
    data = np.array([[3, 4, 1, 1, 5, 2, 3, 4, np.nan, 5],
                         [1, 5, 4, 2, 1, 3, 1, np.nan, 2, 1],
                         [1, 2, 4, 3, 2, np.nan, 2, 4, 4, 5],
                         [5, 4, 5, 5, 2, 2, 4, np.nan, 1, 3],
                         [1, np.nan, 2, 4, 2, np.nan, 1, 3, 5, 2],
                         [3,4,np.nan,1,np.nan,1,5,4,2,3],
                         [1,3,5,np.nan,3,np.nan,2,4,1,5],
                         [1,2,np.nan,4,np.nan,3,2,4,4,1],
                         [2,5,1,2,4,np.nan,2,1,np.nan,np.nan],
                         [4,1,3,2,5,3,np.nan,2,3,1]])
    
    ---------------------------------------------------------------------------
    SolverError                               Traceback (most recent call last)
    <ipython-input-25-123fc995ba03> in <module>
    ----> 1 complete_image(a)
    
    <ipython-input-19-074d2c1581c1> in complete_image(mat_destroyed)
          1 def complete_image(mat_destroyed):
    ----> 2     mat_restored = NuclearNormMinimization().fit_transform(mat_destroyed)
          3     return mat_restored
    
    ~\AppData\Roaming\Python\Python36\site-packages\fancyimpute\solver.py in fit_transform(self, X, y)
        187                     type(X_filled)))
        188 
    --> 189         X_result = self.solve(X_filled, missing_mask)
        190         if not isinstance(X_result, np.ndarray):
        191             raise TypeError(
    
    ~\AppData\Roaming\Python\Python36\site-packages\fancyimpute\nuclear_norm_minimization.py in solve(self, X, missing_mask)
        127             max_iters=self.max_iters,
        128             # use_indirect, see: https://github.com/cvxgrp/cvxpy/issues/547
    --> 129             use_indirect=False)
        130         return S.value
    
    ~\AppData\Roaming\Python\Python36\site-packages\cvxpy\problems\problem.py in solve(self, *args, **kwargs)
        245         else:
        246             solve_func = Problem._solve
    --> 247         return solve_func(self, *args, **kwargs)
        248 
        249     @classmethod
    
    ~\AppData\Roaming\Python\Python36\site-packages\cvxpy\problems\problem.py in _solve(self, solver, ignore_dcp, warm_start, verbose, parallel, **kwargs)
        360         solution = self._solving_chain.solve_via_data(self, data, warm_start, verbose,
        361                                                       kwargs)
    --> 362         self.unpack_results(solution, self._solving_chain, inverse_data)
        363         return self.value
        364 
    
    ~\AppData\Roaming\Python\Python36\site-packages\cvxpy\problems\problem.py in unpack_results(self, solution, chain, inverse_data)
        470                 "Try another solver or solve with verbose=True for more information. " +
        471                 "Try recentering the problem data around 0 and rescaling " +
    --> 472                 "to reduce the dynamic range."
        473             )
        474         self._status = solution.status
    
    SolverError: Solver 'SCS' failed. Try another solver or solve with verbose=True for more information. Try recentering the problem data around 0 and rescaling to reduce the dynamic range.
    
    opened by yonghyeokrhee 11
  • AttributeError: 'KNN' object has no attribute 'complete'

    AttributeError: 'KNN' object has no attribute 'complete'

    THIS IS MY ERROR dataset.dtypes dataset.isnull().sum() hour=364324 test_cl=dataset[0:hour] train_cl=dataset[hour:] train.isnull().sum() test.isnull().sum()

    Xcol =dataset.columns Xcol=Xcol.drop('aqhi') Ycol='aqhi' X = train_cl.loc[:, Xcol] Y = train_cl.loc[:, Ycol] def standardize(s): return s.sub(s.min()).div((s.max() - s.min()))

    Xnorm = X.apply(standardize, axis=0) kvals = np.linspace(1, 100, 20, dtype='int64')

    knn_errs = [] for k in kvals: knn_err = [] Xknn = KNN(k=k, verbose=False).complete(Xnorm) knn_err = cross_val_score(rf, Xknn, Y, cv=24, n_jobs=-1).mean()

    knn_errs.append(knn_err)
    print("[KNN] Estimated RF Test Error (n = {}, k = {}, 10-fold CV): {}".format(len(Xknn), k, np.mean(knn_err)))
    

    sns.set_style("darkgrid") plt.plot(kvals, knn_errs) plt.xlabel('K') plt.ylabel('10-fold CV Error Rate')

    knn_err = max(knn_errs) k_opt = kvals[knn_errs.index(knn_err)]

    Xknn = KNN(k=k_opt, verbose=False).complete(Xnorm) Yknn = Y

    print("[BEST KNN] Estimated RF Test Error (n = {}, k = {}, 10-fold CV): {}".format(len(Xknn), k_opt, np.mean(knn_err))) Traceback (most recent call last):

    File "", line 39, in Xknn = KNN(k=k, verbose=False).complete(Xnorm)

    AttributeError: 'KNN' object has no attribute 'complete'

    opened by hamsterLee 11
  • FancyImpute using KNN : only returns imputed rows and not whole dataframe

    FancyImpute using KNN : only returns imputed rows and not whole dataframe

    Hi,

    I looked into the code of your KNN and found a fill() method has inplace = True, this parameter is set TRUE to ensure it returns the whole data back with missing imputed.

    BUT it only returns rows that were imputed. SO it did not do the impute processing inplace.

    Hope the developer here can comment on this. The code seems to indicate that it returns the whole data, meaning that the imputing was done inplace.

    Hope you can help.

    opened by pablo3p 11
  • cannot import name 'Layer' from 'keras.engine'

    cannot import name 'Layer' from 'keras.engine'

    I used pip install fancyimpute to install fancyimpute. But when I try to import this library, I face this error:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/kasra/.local/lib/python3.8/site-packages/fancyimpute/__init__.py", line 5, in <module>
        from .matrix_factorization import MatrixFactorization
      File "/home/kasra/.local/lib/python3.8/site-packages/fancyimpute/matrix_factorization.py", line 22, in <module>
        from .keras_models import KerasMatrixFactorizer
      File "/home/kasra/.local/lib/python3.8/site-packages/fancyimpute/keras_models.py", line 17, in <module>
        from keras.engine import Layer
    ImportError: cannot import name 'Layer' from 'keras.engine' (/home/kasra/.local/lib/python3.8/site-packages/keras/engine/__init__.py)
    

    my Tensorflow and Keras versions are:

    >>> import tensorflow
    >>> tensorflow.__version__
    '2.5.0'
    >>> import keras
    >>> keras.__version__
    '2.5.0'
    

    and I'm using python3.8 on Linux

    I have the same error in colab(which uses python3.6)

    opened by kkasra12 10
  • NAs of one feature are replaced with same value

    NAs of one feature are replaced with same value

    When using the imputers on a 2D dataset, all NAs of one feature get replaced by the same value. I doubt this is correct and remember that version 0.1.0 imputed missing values individually. What is going on?

    opened by Make42 10
  • Installation issue in Windows (Python 2.7)

    Installation issue in Windows (Python 2.7)

    I'm trying to install fancyimpute in Windows 8.1, Anaconda 2.4.1, Python 2.7.12. But when I try to import it (both on terminal and Spyder environments), I get the error "No module named _multiprocess". I do have multiprocess installed on my system. Any help on this would be great. Please let me know if you need any more information.

    Thanks.

    opened by iceman121 10
  • Keras/Tensorflow Version Issue

    Keras/Tensorflow Version Issue

    Hello, I was using fancyimpute with no problems until a couple weeks ago when I updated by conda environment. Now it seems that fancyimpute is no longer compatible with the new version of keras. I have the following import error " cannot import regularizers from keras".

    I started a new conda environment, with python 3.6, keras 2.4.3, and tensorflow 2.2.0. Now when I run matrix factorization I have the following error: AttributeError: module 'keras.optimizers' has no attribute 'nadam'

    Can you please help me to resolve these dependency issues?

    opened by redraven984 9
  • Reference(s) for the Autoencoder implementation

    Reference(s) for the Autoencoder implementation

    Hi,

    All (or most) of the algorithms have reference papers associated with them. Can you provide some references for the AutoEncoder implementation?

    Thank you for creating such a cool library!

    opened by curiousily 9
  • Pip install not working on macOS Monterey M1

    Pip install not working on macOS Monterey M1

    Hi, I'm in a macOS Monterey M1 (2020) and I'm trying to install fancyimpute without sucess.

    Collecting fancyimpute
      Using cached fancyimpute-0.7.0-py3-none-any.whl
    Collecting pytest
      Using cached pytest-7.1.3-py3-none-any.whl (298 kB)
    Collecting cvxpy
      Using cached cvxpy-1.2.1-cp39-cp39-macosx_10_9_universal2.whl (1.1 MB)
    Collecting knnimpute>=0.1.0
      Using cached knnimpute-0.1.0-py3-none-any.whl
    Collecting cvxopt
      Using cached cvxopt-1.3.0.tar.gz (4.1 MB)
      Preparing metadata (setup.py) ... done
    Collecting nose
      Using cached nose-1.3.7-py3-none-any.whl (154 kB)
    Requirement already satisfied: scikit-learn>=0.24.2 in /Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages (from fancyimpute) (1.1.2)
    Requirement already satisfied: six in /Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages (from knnimpute>=0.1.0->fancyimpute) (1.16.0)
    Requirement already satisfied: numpy>=1.10 in /Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages (from knnimpute>=0.1.0->fancyimpute) (1.23.3)
    Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages (from scikit-learn>=0.24.2->fancyimpute) (3.1.0)
    Requirement already satisfied: joblib>=1.0.0 in /Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages (from scikit-learn>=0.24.2->fancyimpute) (1.2.0)
    Requirement already satisfied: scipy>=1.3.2 in /Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages (from scikit-learn>=0.24.2->fancyimpute) (1.9.1)
    Collecting osqp>=0.4.1
      Using cached osqp-0.6.2.post5.tar.gz (226 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Collecting scs>=1.1.6
      Using cached scs-3.2.0-cp39-cp39-macosx_12_0_arm64.whl
    Collecting ecos>=2
      Using cached ecos-2.0.10-cp39-cp39-macosx_12_0_arm64.whl
    Collecting attrs>=19.2.0
      Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
    Requirement already satisfied: packaging in /Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages (from pytest->fancyimpute) (21.3)
    Collecting py>=1.8.2
      Using cached py-1.11.0-py2.py3-none-any.whl (98 kB)
    Collecting pluggy<2.0,>=0.12
      Using cached pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
    Collecting tomli>=1.0.0
      Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
    Collecting iniconfig
      Using cached iniconfig-1.1.1-py2.py3-none-any.whl (5.0 kB)
    Collecting qdldl
      Using cached qdldl-0.1.5.post2-cp39-cp39-macosx_12_0_arm64.whl
    Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages (from packaging->pytest->fancyimpute) (3.0.9)
    Building wheels for collected packages: cvxopt, osqp
      Building wheel for cvxopt (setup.py) ... error
      error: subprocess-exited-with-error
      
      × python setup.py bdist_wheel did not run successfully.
      │ exit code: 1
      ╰─> [29 lines of output]
          running bdist_wheel
          running build
          running build_py
          creating build
          creating build/lib.macosx-12-arm64-cpython-39
          creating build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/misc.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/_version.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/msk.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/__init__.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/solvers.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/cvxprog.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/modeling.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/info.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/coneprog.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          copying src/python/printing.py -> build/lib.macosx-12-arm64-cpython-39/cvxopt
          UPDATING build/lib.macosx-12-arm64-cpython-39/cvxopt/_version.py
          set build/lib.macosx-12-arm64-cpython-39/cvxopt/_version.py to '1.3.0'
          running build_ext
          building 'gsl' extension
          creating build/temp.macosx-12-arm64-cpython-39
          creating build/temp.macosx-12-arm64-cpython-39/src
          creating build/temp.macosx-12-arm64-cpython-39/src/C
          clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/usr/include/gsl -I/Users/luisescamez/dcycle/recovo-lca/.venv/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/C/gsl.c -o build/temp.macosx-12-arm64-cpython-39/src/C/gsl.o
          src/C/gsl.c:28:10: fatal error: 'gsl/gsl_rng.h' file not found
          #include <gsl/gsl_rng.h>
                   ^~~~~~~~~~~~~~~
          1 error generated.
          error: command '/usr/bin/clang' failed with exit code 1
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for cvxopt
      Running setup.py clean for cvxopt
      Building wheel for osqp (pyproject.toml) ... error
      error: subprocess-exited-with-error
      
      × Building wheel for osqp (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> [176 lines of output]
          Disabling LONG
          Remove long integers for numpy compatibility. See:
           - https://github.com/numpy/numpy/issues/5906
           - https://github.com/ContinuumIO/anaconda-issues/issues/3823
          You can reenable long integers by passing: --osqp --long argument.
          
          running bdist_wheel
          running build
          running build_py
          creating build
          creating build/lib.macosx-12-arm64-cpython-39
          creating build/lib.macosx-12-arm64-cpython-39/osqppurepy
          copying src/osqppurepy/interface.py -> build/lib.macosx-12-arm64-cpython-39/osqppurepy
          copying src/osqppurepy/_osqp.py -> build/lib.macosx-12-arm64-cpython-39/osqppurepy
          copying src/osqppurepy/__init__.py -> build/lib.macosx-12-arm64-cpython-39/osqppurepy
          creating build/lib.macosx-12-arm64-cpython-39/osqp
          copying src/osqp/_version.py -> build/lib.macosx-12-arm64-cpython-39/osqp
          copying src/osqp/interface.py -> build/lib.macosx-12-arm64-cpython-39/osqp
          copying src/osqp/__init__.py -> build/lib.macosx-12-arm64-cpython-39/osqp
          copying src/osqp/utils.py -> build/lib.macosx-12-arm64-cpython-39/osqp
          creating build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/mkl_pardiso_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/warm_start_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/polishing_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/derivative_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/codegen_matrices_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/update_matrices_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/primal_infeasibility_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/codegen_vectors_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/utils.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/non_convex_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/unconstrained_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/dual_infeasibility_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/basic_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/feasibility_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          copying src/osqp/tests/multithread_test.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests
          creating build/lib.macosx-12-arm64-cpython-39/osqp/codegen
          copying src/osqp/codegen/__init__.py -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen
          copying src/osqp/codegen/utils.py -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen
          copying src/osqp/codegen/code_generator.py -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen
          creating build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/__init__.py -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          creating build/lib.macosx-12-arm64-cpython-39/osqp/codegen/files_to_generate
          copying src/osqp/codegen/files_to_generate/setup.py -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/files_to_generate
          running egg_info
          writing src/osqp.egg-info/PKG-INFO
          writing dependency_links to src/osqp.egg-info/dependency_links.txt
          writing requirements to src/osqp.egg-info/requires.txt
          writing top-level names to src/osqp.egg-info/top_level.txt
          listing git files failed - pretending there aren't any
          reading manifest file 'src/osqp.egg-info/SOURCES.txt'
          reading manifest template 'MANIFEST.in'
          adding license file 'LICENSE'
          writing manifest file 'src/osqp.egg-info/SOURCES.txt'
          creating build/lib.macosx-12-arm64-cpython-39/extension
          creating build/lib.macosx-12-arm64-cpython-39/extension/include
          copying src/extension/include/osqpinfopy.h -> build/lib.macosx-12-arm64-cpython-39/extension/include
          copying src/extension/include/osqpmodulemethods.h -> build/lib.macosx-12-arm64-cpython-39/extension/include
          copying src/extension/include/osqpobjectpy.h -> build/lib.macosx-12-arm64-cpython-39/extension/include
          copying src/extension/include/osqpresultspy.h -> build/lib.macosx-12-arm64-cpython-39/extension/include
          copying src/extension/include/osqputilspy.h -> build/lib.macosx-12-arm64-cpython-39/extension/include
          copying src/extension/include/osqpworkspacepy.h -> build/lib.macosx-12-arm64-cpython-39/extension/include
          creating build/lib.macosx-12-arm64-cpython-39/extension/src
          copying src/extension/src/.gitignore -> build/lib.macosx-12-arm64-cpython-39/extension/src
          copying src/extension/src/osqpmodule.c -> build/lib.macosx-12-arm64-cpython-39/extension/src
          copying src/osqp/codegen/.gitignore -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen
          copying src/osqp/tests/solutions/test_basic_QP.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_feasibility_problem.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_polish_random.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_polish_simple.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_polish_unconstrained.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_solve.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_unconstrained_problem.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_A.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_A_allind.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_P.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_P_A_allind.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_P_A_indA.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_P_A_indP.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_P_A_indP_indA.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_P_allind.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_bounds.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_l.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_q.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/tests/solutions/test_update_u.npz -> build/lib.macosx-12-arm64-cpython-39/osqp/tests/solutions
          copying src/osqp/codegen/files_to_generate/CMakeLists.txt -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/files_to_generate
          copying src/osqp/codegen/files_to_generate/emosqpmodule.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/files_to_generate
          copying src/osqp/codegen/files_to_generate/example.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/files_to_generate
          creating build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources
          creating build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/configure
          copying src/osqp/codegen/sources/configure/osqp_configure.h.in -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/configure
          copying src/osqp/codegen/sources/configure/qdldl_types.h.in -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/configure
          creating build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/CMakeLists.txt -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/auxil.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/constants.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/error.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/glob_opts.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/kkt.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/lin_alg.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/osqp.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/proj.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/qdldl.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/qdldl_interface.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/scaling.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/types.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          copying src/osqp/codegen/sources/include/util.h -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/include
          creating build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/CMakeLists.txt -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/auxil.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/error.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/kkt.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/lin_alg.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/osqp.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/proj.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/qdldl.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/qdldl_interface.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/scaling.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          copying src/osqp/codegen/sources/src/util.c -> build/lib.macosx-12-arm64-cpython-39/osqp/codegen/sources/src
          running build_ext
          Traceback (most recent call last):
            File "/Users/luisescamez/dcycle/recovo-lca/.venv/bin/cmake", line 5, in <module>
              from cmake import cmake
          ModuleNotFoundError: No module named 'cmake'
          Traceback (most recent call last):
            File "/Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
              main()
            File "/Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
            File "/Users/luisescamez/dcycle/recovo-lca/.venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
              return _build_backend().build_wheel(wheel_directory, config_settings,
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 412, in build_wheel
              return self._build_with_temp_dir(['bdist_wheel'], '.whl',
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir
              self.run_setup()
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
              exec(code, locals())
            File "<string>", line 256, in <module>
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
              return distutils.core.setup(**attrs)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
              return run_commands(dist)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
              dist.run_commands()
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
              self.run_command(cmd)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
              super().run_command(command)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
              cmd_obj.run()
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
              self.run_command('build')
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
              self.distribution.run_command(command)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
              super().run_command(command)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
              cmd_obj.run()
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
              self.run_command(cmd_name)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
              self.distribution.run_command(command)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
              super().run_command(command)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
              cmd_obj.run()
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
              _build_ext.run(self)
            File "/private/var/folders/9t/622zvlfx2sggc2gtvl9m_60h0000gn/T/pip-build-env-g99b_the/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
              self.build_extensions()
            File "<string>", line 216, in build_extensions
            File "/opt/homebrew/Cellar/[email protected]/3.9.14/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output
              return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
            File "/opt/homebrew/Cellar/[email protected]/3.9.14/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
              raise CalledProcessError(retcode, process.args,
          subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1.
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for osqp
    Failed to build cvxopt osqp
    ERROR: Could not build wheels for osqp, which is required to install pyproject.toml-based projects
    

    It looks like there is a dependency error from suite-sparse and cmake:

    image

    My Python version is 3.9.14 and pip version is pip 22.2.2

    opened by decause95 2
Releases(0.5.5)
Owner
Alex Rubinsteyn
Genes and vectors
Alex Rubinsteyn
Large-scale linear classification, regression and ranking in Python

lightning lightning is a library for large-scale linear classification, regression and ranking in Python. Highlights: follows the scikit-learn API con

null 1.6k Dec 31, 2022
A Python library for dynamic classifier and ensemble selection

DESlib DESlib is an easy-to-use ensemble learning library focused on the implementation of the state-of-the-art techniques for dynamic classifier and

null 425 Dec 18, 2022
A Python Package to Tackle the Curse of Imbalanced Datasets in Machine Learning

imbalanced-learn imbalanced-learn is a python package offering a number of re-sampling techniques commonly used in datasets showing strong between-cla

null 6.2k Jan 1, 2023
(AAAI' 20) A Python Toolbox for Machine Learning Model Combination

combo: A Python Toolbox for Machine Learning Model Combination Deployment & Documentation & Stats Build Status & Coverage & Maintainability & License

Yue Zhao 606 Dec 21, 2022
Topological Data Analysis for Python🐍

Scikit-TDA is a home for Topological Data Analysis Python libraries intended for non-topologists. This project aims to provide a curated library of TD

Scikit-TDA 373 Dec 24, 2022
machine learning with logical rules in Python

skope-rules Skope-rules is a Python machine learning module built on top of scikit-learn and distributed under the 3-Clause BSD license. Skope-rules a

null 504 Dec 31, 2022
Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP(Traveling salesman)

scikit-opt Swarm Intelligence in Python (Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Algorithm, Immune Algorithm,A

郭飞 3.7k Jan 1, 2023
Companion "receiver" to matrix-appservice-webhooks for [matrix].

Matrix Webhook Receiver Companion "receiver" to matrix-appservice-webhooks for [matrix]. The purpose of this app is to listen for generic webhook mess

Kim Brose 13 Sep 29, 2022
SGMC: Spectral Graph Matrix Completion

SGMC: Spectral Graph Matrix Completion Code for AAAI21 paper "Scalable and Explainable 1-Bit Matrix Completion via Graph Signal Learning". Data Format

Chao Chen 8 Dec 12, 2022
Python package for missing-data imputation with deep learning

MIDASpy Overview MIDASpy is a Python package for multiply imputing missing data using deep learning methods. The MIDASpy algorithm offers significant

MIDASverse 77 Dec 3, 2022
Multiple Imputation with Random Forests in Python

miceforest: Fast, Memory Efficient Imputation with lightgbm Fast, memory efficient Multiple Imputation by Chained Equations (MICE) with lightgbm. The

Samuel Wilson 202 Dec 31, 2022
This is the official Pytorch implementation of "Lung Segmentation from Chest X-rays using Variational Data Imputation", Raghavendra Selvan et al. 2020

README This is the official Pytorch implementation of "Lung Segmentation from Chest X-rays using Variational Data Imputation", Raghavendra Selvan et a

Raghav 42 Dec 15, 2022
A Python 3 library making time series data mining tasks, utilizing matrix profile algorithms

MatrixProfile MatrixProfile is a Python 3 library, brought to you by the Matrix Profile Foundation, for mining time series data. The Matrix Profile is

Matrix Profile Foundation 302 Dec 29, 2022
MBTR is a python package for multivariate boosted tree regressors trained in parameter space.

MBTR is a python package for multivariate boosted tree regressors trained in parameter space.

SUPSI-DACD-ISAAC 61 Dec 19, 2022
Connectionist Temporal Classification (CTC) decoding algorithms: best path, beam search, lexicon search, prefix search, and token passing. Implemented in Python.

CTC Decoding Algorithms Update 2021: installable Python package Python implementation of some common Connectionist Temporal Classification (CTC) decod

Harald Scheidl 736 Jan 3, 2023
Library for implementing reservoir computing models (echo state networks) for multivariate time series classification and clustering.

Framework overview This library allows to quickly implement different architectures based on Reservoir Computing (the family of approaches popularized

Filippo Bianchi 249 Dec 21, 2022
The source code and data of the paper "Instance-wise Graph-based Framework for Multivariate Time Series Forecasting".

IGMTF The source code and data of the paper "Instance-wise Graph-based Framework for Multivariate Time Series Forecasting". Requirements The framework

Wentao Xu 24 Dec 5, 2022
All Algorithms implemented in Python

The Algorithms - Python All algorithms implemented in Python (for education) These implementations are for learning purposes only. Therefore they may

The Algorithms 150.6k Jan 3, 2023
Algorithms implemented in Python

Python Algorithms Library Laurent Luce Description The purpose of this library is to help you with common algorithms like: A* path finding. String Mat

Laurent Luce 264 Dec 6, 2022
Leetcode solutions - All algorithms implemented in Python 3 (for education)

Leetcode solutions - All algorithms implemented in Python 3 (for education)

Vineet Dhaimodker 3 Oct 21, 2022