Skip to content

Commit e891509

Browse files
authored
refactor: Fix matrix display deprecation (TheAlgorithms#7729)
1 parent e906a51 commit e891509

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: machine_learning/xgboost_classifier.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import numpy as np
33
from matplotlib import pyplot as plt
44
from sklearn.datasets import load_iris
5-
from sklearn.metrics import plot_confusion_matrix
5+
from sklearn.metrics import ConfusionMatrixDisplay
66
from sklearn.model_selection import train_test_split
77
from xgboost import XGBClassifier
88

@@ -63,7 +63,7 @@ def main() -> None:
6363
xgboost_classifier = xgboost(x_train, y_train)
6464

6565
# Display the confusion matrix of the classifier with both training and test sets
66-
plot_confusion_matrix(
66+
ConfusionMatrixDisplay.from_estimator(
6767
xgboost_classifier,
6868
x_test,
6969
y_test,

0 commit comments

Comments
 (0)