smote_variants
smote_variants copied to clipboard
sv.MulticlassOversampling error for getattr() function
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'])
Thank you for raising, I look into it.
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.