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

sv.MulticlassOversampling error for getattr() function #75

Open
azamkamranian opened this issue Jul 30, 2023 · 2 comments
Open

sv.MulticlassOversampling error for getattr() function #75

azamkamranian opened this issue Jul 30, 2023 · 2 comments

Comments

@azamkamranian
Copy link

azamkamranian commented Jul 30, 2023

I was checking the document's example of package. The following example gave me the error 'TypeError: getattr(): attribute name must be string'. Why?

import smote_variants as sv

Import sklearn.datasets as datasets 

dataset= datasets.load_wine() 

oversampler= sv.MulticlassOversampling(sv.distance_SMOTE) 

X_samp, y_samp= oversampler.sample(dataset['data'], dataset['target'])
@gykovacs
Copy link
Member

Thank you for raising, I look into it.

@gykovacs
Copy link
Member

gykovacs commented Oct 2, 2023

Correct, there was a minor change in the interface recently and the docs have not been updated accordingly. Now I updated, it should be out with the next release (in a couple of days).

The correct use:

oversampler = sv.MulticlassOversampling(oversampler='distance_SMOTE', oversampler_params={})

You can specify any parametrization through the oversampler_params argument.

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