File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1010def data_handling (data : dict ) -> tuple :
1111 """
1212 Split dataset into features and target.
13-
13+
1414 >>> from sklearn.datasets import load_iris
1515 >>> iris = load_iris()
1616 >>> features, targets = data_handling(iris)
@@ -25,7 +25,7 @@ def data_handling(data: dict) -> tuple:
2525def xgboost (features : np .ndarray , target : np .ndarray ) -> XGBClassifier :
2626 """
2727 Train an XGBoost classifier.
28-
28+
2929 >>> from sklearn.datasets import load_iris
3030 >>> iris = load_iris()
3131 >>> X_train, y_train = iris.data[:100], iris.target[:100]
@@ -54,10 +54,10 @@ def main() -> None:
5454 features , targets , test_size = 0.25 , random_state = 42
5555 )
5656 names = iris ["target_names" ]
57-
57+
5858 # Create an XGBoost Classifier from the training data
5959 xgboost_classifier = xgboost (x_train , y_train )
60-
60+
6161 # Display the confusion matrix of the classifier with test set
6262 ConfusionMatrixDisplay .from_estimator (
6363 xgboost_classifier ,
@@ -73,5 +73,6 @@ def main() -> None:
7373
7474if __name__ == "__main__" :
7575 import doctest
76+
7677 doctest .testmod (verbose = True )
77- main ()
78+ main ()
You can’t perform that action at this time.
0 commit comments