@@ -9,13 +9,15 @@ def __init__(self, model_type='xgboost',
9
9
n_estimators = 100 ,
10
10
learning_rate = 0.1 ,
11
11
max_depth = 3 ,
12
- subsample = 1.0 ,
12
+ subsample = 1.0 ,
13
+ verbosity = 0 ,
13
14
** kwargs ):
14
15
self .model_type = model_type
15
16
self .n_estimators = n_estimators
16
17
self .learning_rate = learning_rate
17
18
self .max_depth = max_depth
18
19
self .subsample = subsample
20
+ self .verbosity = verbosity
19
21
# xgboost -----
20
22
# n_estimators
21
23
# learning_rate
@@ -37,6 +39,7 @@ def __init__(self, model_type='xgboost',
37
39
'learning_rate' : self .learning_rate ,
38
40
'subsample' : self .subsample ,
39
41
'max_depth' : self .max_depth ,
42
+ 'verbosity' : self .verbosity ,
40
43
** kwargs
41
44
}
42
45
elif self .model_type == "lightgbm" :
@@ -45,6 +48,7 @@ def __init__(self, model_type='xgboost',
45
48
'learning_rate' : self .learning_rate ,
46
49
'bagging_fraction' : self .subsample ,
47
50
'max_depth' : self .max_depth ,
51
+ 'verbose' : self .verbosity - 1 if self .verbosity == 0 else self .verbosity
48
52
** kwargs
49
53
}
50
54
elif self .model_type == "catboost" :
@@ -53,13 +57,14 @@ def __init__(self, model_type='xgboost',
53
57
'learning_rate' : self .learning_rate ,
54
58
'rsm' : self .subsample ,
55
59
'depth' : self .max_depth ,
60
+ 'verbose' : self .verbosity
56
61
** kwargs
57
62
}
58
63
59
64
if model_type == 'xgboost' :
60
65
self .model = XGBClassifier (** self .params )
61
66
elif model_type == 'catboost' :
62
- self .model = CatBoostClassifier (** self .params )
67
+ self .model = CatBoostClassifier (** self .params , logging_level = 'Silent' )
63
68
elif model_type == 'lightgbm' :
64
69
self .model = LGBMClassifier (** self .params )
65
70
else :
0 commit comments