Skip to content

Conversation

alxnkt
Copy link

@alxnkt alxnkt commented Jan 5, 2022

Fix issue about using LabelEncoder.transform and np.array functions, as they accept only arrays.

Fix issue about using LabelEncoder.transform and np.array functions, as they accept only arrays.
Copy link

@RahulVadisetty91 RahulVadisetty91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re233w

The cross_validation module has been deprecated and replaced with model_selection in the newer versions of scikit-learn.

from sklearn.model_selection import train_test_split, cross_val_score

Update all instances of cross_validation to model_selection, like this:

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=5)
f1 = cross_val_score(classifier, X, y, scoring='f1_weighted', cv=3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants