Spaces:
Sleeping
Sleeping
LLH
commited on
Commit
·
0c19671
1
Parent(s):
2605e64
2024/03/09/11:45
Browse files
analysis/model_train/tree_model.py
CHANGED
@@ -99,12 +99,21 @@ class DecisionTreeClassifierParams:
|
|
99 |
|
100 |
# 决策树分类
|
101 |
def decision_tree_classifier(container, params):
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
x_train, y_train, x_test, y_test, hyper_params_optimize = get_values_from_container_class(container)
|
103 |
info = {}
|
104 |
|
105 |
params = transform_params_list(DecisionTreeClassifierParams, params)
|
106 |
params['random_state'] = [StaticValue.RANDOM_STATE]
|
107 |
|
|
|
|
|
|
|
108 |
random_forest_regression_model = DecisionTreeClassifier(random_state=StaticValue.RANDOM_STATE)
|
109 |
|
110 |
if hyper_params_optimize == "grid_search":
|
|
|
99 |
|
100 |
# 决策树分类
|
101 |
def decision_tree_classifier(container, params):
|
102 |
+
import logging
|
103 |
+
logging.basicConfig(level=logging.NOTSET)
|
104 |
+
logging.info(str(params), logging.getLevelName(logging.INFO))
|
105 |
+
print(str(params))
|
106 |
+
|
107 |
+
|
108 |
x_train, y_train, x_test, y_test, hyper_params_optimize = get_values_from_container_class(container)
|
109 |
info = {}
|
110 |
|
111 |
params = transform_params_list(DecisionTreeClassifierParams, params)
|
112 |
params['random_state'] = [StaticValue.RANDOM_STATE]
|
113 |
|
114 |
+
logging.info(str(params), logging.getLevelName(logging.INFO))
|
115 |
+
print(str(params))
|
116 |
+
|
117 |
random_forest_regression_model = DecisionTreeClassifier(random_state=StaticValue.RANDOM_STATE)
|
118 |
|
119 |
if hyper_params_optimize == "grid_search":
|