analyticalmindsltd / smote_variants

A collection of 85 minority oversampling techniques (SMOTE) for imbalanced learning with multi-class oversampling and model selection features
http://smote-variants.readthedocs.io
MIT License
632 stars 137 forks source link

I want to use in my dataset to apply smote variants but is not working #6

Closed arjunpuri7 closed 5 years ago

arjunpuri7 commented 5 years ago

I want to use evaluate_oversampler method on my datasets and perform following steps: import smote_variants as sv import pandas as pd import numpy as np data=pd.read_csv(".........original/glass0.csv") x=data.drop('10',axis=1) X=x.as_matrix() y=data.iloc[:,-1] Y=y.as_matrix() datasets={'data':X,'target':Y,'name':'glass0'} print(datasets) oversamplers= [sv.SMOTE_ENN, sv.NEATER, sv.Lee] classifiers= [KNeighborsClassifier(n_neighbors= 3), KNeighborsClassifier(n_neighbors= 5), DecisionTreeClassifier()] cache_path= 'C:/Users/hp/Desktop/python codes/structure'

results= sv.evaluate_oversamplers(datasets, oversamplers, classifiers, cache_path)

after applying all this i get an error;

error

gykovacs commented 5 years ago

Hi @arjunpuri7, the evaluate_oversamplers function takes a list of datasets to evaluate on, therefore, all you need to do is put the dataset specification in a list as

datasets=[{'data':X,'target':Y,'name':'glass0'}]

Let me know if it works!

arjunpuri7 commented 5 years ago

i try and it works thanks