Created
June 18, 2020 14:17
-
-
Save nitin-bommi/3aaf3bfc30cbe827ccbf00f9c939a153 to your computer and use it in GitHub Desktop.
interpreting confusion matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creating some predictions. | |
from sklearn.model_selection import cross_val_predict | |
y_train_pred = cross_val_predict(sgd_clf, X_train, y_train_5, cv=3) | |
""" | |
You could make predictions on the test set, but use the test set only at the very end of your project, once you have a classifier that you are ready to launch. | |
""" | |
# Constructing the confusion matrix. | |
from sklearn.metrics import confusion_matrix | |
confusion_matrix(y_train_5, y_train_pred) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment