We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e906a51 commit e891509Copy full SHA for e891509
machine_learning/xgboost_classifier.py
@@ -2,7 +2,7 @@
2
import numpy as np
3
from matplotlib import pyplot as plt
4
from sklearn.datasets import load_iris
5
-from sklearn.metrics import plot_confusion_matrix
+from sklearn.metrics import ConfusionMatrixDisplay
6
from sklearn.model_selection import train_test_split
7
from xgboost import XGBClassifier
8
@@ -63,7 +63,7 @@ def main() -> None:
63
xgboost_classifier = xgboost(x_train, y_train)
64
65
# Display the confusion matrix of the classifier with both training and test sets
66
- plot_confusion_matrix(
+ ConfusionMatrixDisplay.from_estimator(
67
xgboost_classifier,
68
x_test,
69
y_test,
0 commit comments