ZhiningLiu1998 / imbalanced-ensemble

🛠️ Class-imbalanced Ensemble Learning Toolbox. | 类别不平衡/长尾机器学习库
https://imbalanced-ensemble.readthedocs.io
MIT License
326 stars 51 forks source link

Does not seem to be a scikit-learn estimator #19

Closed marutilai closed 1 year ago

marutilai commented 1 year ago

Getting the error in the code provided in examples

image

Coming from this line: clf.fit(X_train, y_train) from this notebook https://github.com/ZhiningLiu1998/imbalanced-ensemble/blob/main/examples/classification/plot_classifier_comparison.py

ZhiningLiu1998 commented 1 year ago

Hi,

Thanks for pointing this out. Since sklearn version 1.2, the base_estimator is deprecated and will be removed in 1.4. They renamed this parameter to estimator (See HERE). Thus I recently made some commits to accommodate this change, you can try clone and installing the latest version locally:

$ git clone https://github.com/ZhiningLiu1998/imbalanced-ensemble.git $ cd imbalanced-ensemble $ pip install .

The example should work once you install the latest version.

After all the updates are done, I'll release a new version to PyPi.

marutilai commented 1 year ago

Thanks @ZhiningLiu1998. I tried testing again and got this new error message:

image
marutilai commented 1 year ago

Thanks, Zhining! Found another issue trying the latest commit

https://github.com/ZhiningLiu1998/imbalanced-ensemble/issues/19#issuecomment-1426838265

On Sat, Feb 11, 2023 at 11:53 AM Zhining Liu @.***> wrote:

Hi,

Thanks for pointing this out. Since sklearn version 1.2, the base_estimator is deprecated and will be removed in 1.4. They renamed this parameter to estimator (See HERE https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.AdaBoostClassifier.html#sklearn.ensemble.AdaBoostClassifier). Thus I recently made some commits to accommodate this change, you can try clone and installing the latest version locally:

$ git clone https://github.com/ZhiningLiu1998/imbalanced-ensemble.git $ cd imbalanced-ensemble $ pip install .

The example should work once you install the latest version.

After all the updates are done, I'll release a new version to PyPi.

— Reply to this email directly, view it on GitHub https://github.com/ZhiningLiu1998/imbalanced-ensemble/issues/19#issuecomment-1426821703, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVCOZS7E3AGDJVPD2L4LGBTWW67YJANCNFSM6AAAAAAUYXVOEQ . You are receiving this because you authored the thread.Message ID: @.***>

ZhiningLiu1998 commented 1 year ago

Oh thank you, I'll look into it now

ZhiningLiu1998 commented 1 year ago

Hi there, I just make a commit to fix this. I tested the BalancedRandomForestClassifier and the plot_classifier_comparison.py locally and they work fine, please try it and let me know if the issue persists. Thanks.

marutilai commented 1 year ago

It works now. Thanks @ZhiningLiu1998!