{"version":"1.0","type":"rich","title":"Confusion matrix in scikit-learn","description":"This example shows two confusion matrices for evaluating a GradientBoostingClassifier’s predictions on a binary test set, using scikit-learn’s `confusion_matrix` function. The first plot displays raw counts of true versus predicted labels, while the second normalizes each row to show proportions. Both use `plt.imshow` with a blue colormap, annotated with counts or normalized values, and include axis labels for true and predicted classes. The code defines a custom `plot_confusion_matrix` function that applies `imshow`, colorbar, and text annotations, and saves each figure as a PNG.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-9b764afaa7ebd4e7e056ce6e4aa82563?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}