File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
# XGBoost Classifier Example
2
- from doctest import testmod
3
-
4
2
from matplotlib import pyplot as plt
5
3
from sklearn .datasets import load_iris
6
4
from sklearn .metrics import plot_confusion_matrix
7
5
from sklearn .model_selection import train_test_split
8
6
from xgboost import XGBClassifier
9
7
10
8
11
- def data_handling (data ) -> list :
9
+ def data_handling (data : list ) -> tuple :
12
10
# Split dataset into train and test data
13
11
x = data ["data" ] # features
14
12
y = data ["target" ]
15
13
return x , y
16
14
17
15
18
- def xgboost (features , target ):
16
+ def xgboost (features : list , target : list ):
19
17
classifier = XGBClassifier ()
20
18
classifier .fit (features , target )
21
19
return classifier
@@ -54,4 +52,4 @@ def main() -> None:
54
52
55
53
56
54
if __name__ == "__main__" :
57
- testmod ( name = " main" , verbose = True )
55
+ main ( )
You can’t perform that action at this time.
0 commit comments