Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test error: __init__() got an unexpected keyword argument 'presort' #13

Open
eskrav opened this issue Mar 4, 2021 · 2 comments
Open

Comments

@eskrav
Copy link

eskrav commented Mar 4, 2021

Running package tests results in the following error (python version 3.6.12, sklearn 0.24.1, numpy 1.17.5, scipy 1.4.1, cython 0.29.22, pydotplus 2.0.2, matplotlib 3.0.3, jupyter 1.0.0, pyyaml 5.4.1):

ekravtchenko@server:~/iterative-Random-Forest$ python irf/tests/test_irf_utils.py
Traceback (most recent call last):
  File "irf/tests/test_irf_utils.py", line 14, in <module>
    sklearn_ds=breast_cancer, n_estimators=10)
  File "/home/ekravtchenko/iterative-Random-Forest/irf/irf_jupyter_utils.py", line 110, in generate_rf_example
    rf.fit(X=X_train, y=y_train)
  File "/home/ekravtchenko/iterative-Random-Forest/irf/ensemble/wrf.py", line 20, in fit
    self.base_estimator = WeightedDecisionTreeClassifier()
  File "/home/ekravtchenko/iterative-Random-Forest/irf/tree/tree.py", line 401, in __init__
    ccp_alpha=ccp_alpha)
  File "/home/ekravtchenko/.conda/envs/new_frgpy/lib/python3.6/site-packages/sklearn/utils/validation.py", line 63, in inner_f
    return f(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'presort'

ekravtchenko@server:~/iterative-Random-Forest$ python irf/tests/test_irf_weighted.py
Traceback (most recent call last):
  File "irf/tests/test_irf_weighted.py", line 70, in <module>
    test_iRF_weight1()
  File "irf/tests/test_irf_weighted.py", line 34, in test_iRF_weight1
    n_estimators_bootstrap=5)
  File "/home/ekravtchenko/iterative-Random-Forest/irf/irf_utils.py", line 589, in run_iRF
    X_test = X_test, y_test = y_test)
  File "/home/ekravtchenko/iterative-Random-Forest/irf/ensemble/wrf.py", line 65, in fit
    feature_weight=feature_importances)
  File "/home/ekravtchenko/iterative-Random-Forest/irf/ensemble/wrf.py", line 20, in fit
    self.base_estimator = WeightedDecisionTreeClassifier()
  File "/home/ekravtchenko/iterative-Random-Forest/irf/tree/tree.py", line 401, in __init__
    ccp_alpha=ccp_alpha)
  File "/home/ekravtchenko/.conda/envs/new_frgpy/lib/python3.6/site-packages/sklearn/utils/validation.py", line 63, in inner_f
    return f(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'presort'
@akialbz
Copy link

akialbz commented Mar 7, 2021

I believe that's because the presort parameter has been deprecated and removed from the 0.24 scikit-learn

@eskrav
Copy link
Author

eskrav commented Mar 9, 2021

Thanks! It does indeed work if I install a previous version of scikit-learn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants