Closed arjunpuri7 closed 4 years ago
I use code 'Integration with sklearn' but error appear:
module 'smote_variants' has no attribute 'OversamplingClassifier'
I update library but still not working. please help me out
Could you please provide the details of your system and also a minimal sample code which is not working?
windows 8.1 version of python: 3.6.4
code import smote_variants as sv import imblearn.datasets as imb_datasets
from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler from sklearn.neighbors import KNeighborsClassifier
libras= imb_datasets.fetch_datasets()['libras_move'] X, y= libras['data'], libras['target']
oversampler= sv.MulticlassOversampling(sv.distance_SMOTE()) classifier= KNeighborsClassifier(n_neighbors= 5)
model= Pipeline([('scale', StandardScaler()), ('clf', sv.OversamplingClassifier(oversampler, classifier))])
model.fit(X, y)
This is definitely a working sample code. What does
sv.version
give?
Sorry, github formatted the text, as a code:
sv.__version__
sorry, for delay in response. The version of smote_variants : 0.3.4
now its working thanks...
I want to calculate true positive and true negative in my model and trying to use sklearn.metrics using some techniques mentioned in smote_variants. how can I uses these metrics with smote_variants? if not can you provide true positive, true negative rate in your module?
from, Arjun Puri