Confusion Matrix Sklearn Example

Python

 1|  from sklearn.metrics import classification_report
 2|  
 3|  # make predictions for test set
 4|  y_pred = model.predict(X_test)
 5|  
 6|  # output classification report
 7|  print('Classification Report:')
 8|  print(classification_report(y_test, y_pred))
Did you find this snippet useful?

Sign up for free to to add this to your code library