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

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

Closed
arjunpuri7 opened this issue Jul 7, 2019 · 3 comments
Closed

Comments

@arjunpuri7
Copy link

No description provided.

@arjunpuri7 arjunpuri7 changed the title i want to use in my dataset to apply smote variants but is not working I want to use in my dataset to apply smote variants but is not working Jul 7, 2019
@arjunpuri7
Copy link
Author

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
Copy link
Member

gykovacs commented Jul 7, 2019

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
Copy link
Author

i try and it works thanks

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