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

OversamplingClassifier does not work with probability-based metrics #77

Open
oleg-kachan opened this issue Sep 12, 2023 · 3 comments
Open

Comments

@oleg-kachan
Copy link

oleg-kachan commented Sep 12, 2023

I use custom scorer from sklearn, via make_scorer function. It does not work if needs_proba=True, so metrics like ROC AUC, PR AUC are unfeasible to be used with smote_variants.

The error says OversamplingClassifier does not have _classes field, had been the latest version pushed to pip?

@gykovacs
Copy link
Member

Thank you for raising, I look into it.

@oleg-kachan
Copy link
Author

oleg-kachan commented Sep 26, 2023

I have a version 0.7.1 installed via pip and I don't see several lines which are present in the main branch of the github repo. So, maybe you need to update pypi by the latest version of the code?

The lines are in the following file https://github.com/analyticalmindsltd/smote_variants/blob/master/smote_variants/classifiers/_oversamplingclassifier.py

line 30, OversamplingClassifier._init_():
self.classes_ = None

line 47, OversamplingClassifier.fit():
self.classes_ = self.classifier_obj.classes_

@gykovacs
Copy link
Member

gykovacs commented Oct 2, 2023

Yes, this is the issue. I have prepared the release of 0.7.2, but one of the dependencies (metric-learn) struggles with the latest version of numpy. As soon as they fix it (already done, but not released yet), I will release 0.7.2 to PyPI, until that, you should be able to use it from the repo here.

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