Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

confusion matrix

# Import confusion matrix
from sklearn.metrics import confusion_matrix, classification_report
# Fit the model to the training data
# Predict the labels of the test data: y_pred

# Generate the confusion matrix and classification report
print(confusion_matrix(y_test, y_pred))
print(classification_report(y_test, y_pred))
Source by campus.datacamp.com #
 
PREVIOUS NEXT
Tagged: #confusion #matrix
ADD COMMENT
Topic
Name
9+7 =