albahnsen / CostSensitiveClassification

CostSensitiveClassification Library in Python
BSD 3-Clause "New" or "Revised" License
207 stars 83 forks source link

costcla incompatible with latest version of Scikit-Learn #22

Closed guruprad closed 4 years ago

guruprad commented 4 years ago

It seems that scikit-learn versions 0.21 and above have deprecated and removed sklearn.externals.six and sklearn.externals.joblib according to this release notes. Is there any plans to accommodate this change or raise this issue in the setup.py script (as of now the sklearn requirements are explicitly listed as 'scikit-learn>=0.15.0b2')? I can also take a stab at creating a PR for this issue but am unaware of the etiquette and guidelines. Furthermore, I notice there is a lack of automated testing so I am unsure if I would break something :D .

albahnsen commented 4 years ago

yes indeed we need to solve this. if you can do the PR I will appreciated.

BingeCode commented 4 years ago

I found the issue and have a fix ready in my cloned repo. I have never contributed to an open source project, though, and was not able to figure out how to push the changes in my local branch '22_incompatible_scikit_learn' or how to create the PR. Seems like I don't have permissions.

It's just a fix of imports in two files.

After this, everything works for me so far, but a FutureWarning persists:

FutureWarning: The sklearn.ensemble.base module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.ensemble. Anything that cannot be imported from sklearn.ensemble is now part of the private API.

This can be fixed in .\costcla\models\bagging.py change as well by changing from sklearn.ensemble.base import to from sklearn.ensemble import

Errors unrelated to the imports remain, but that should be looked into by someone more experienced than me :P

Hope this helps others like me who need to use this package for their work / academic studies.

BingeCode commented 4 years ago

Btw, @albahnsen similar fixes would need to be done in the pyea package, which I could do, if I had the right permissions/knowledge how to push my changes.

albahnsen commented 4 years ago

@BingeCode thank you so much for the help. to push the changes you can, fork the repository, make the changes to your repository, then on github click on pull request (from your fork or copy of the repository), It is simple after you do it the first time. Again thank you for the interest in helping with this project.

BingeCode commented 4 years ago

@albahnsen thanks for the heads up. I created the pull request that fixes the aforementioned errors.

albahnsen commented 4 years ago

Excelent work, thank you so much. I already merged the PR.