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

Correct income_classifier.py #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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