|
@@ -56,7 +56,7 @@ class LightGBM(object):
|
|
|
]
|
|
|
self.split_c = 0.99
|
|
|
self.yc = 0.8
|
|
|
- self.model = "lightgbm_tag_train_02.bin"
|
|
|
+ self.model = "lightgbm_tag_train_04.bin"
|
|
|
|
|
|
def bays_params(self, trial):
|
|
|
"""
|
|
@@ -163,7 +163,7 @@ class LightGBM(object):
|
|
|
评估模型性能
|
|
|
:return:
|
|
|
"""
|
|
|
- fw = open("summary_tag_03.txt", "a+", encoding="utf-8")
|
|
|
+ fw = open("summary_tag_04.txt", "a+", encoding="utf-8")
|
|
|
# 测试数据
|
|
|
with open("produce_data/x_data_total_return_predict.json") as f1:
|
|
|
x_list = json.loads(f1.read())
|
|
@@ -180,7 +180,7 @@ class LightGBM(object):
|
|
|
X_test[key] = pd.to_numeric(X_test[key], errors="coerce")
|
|
|
bst = lgb.Booster(model_file=self.model)
|
|
|
y_pred = bst.predict(X_test, num_iteration=bst.best_iteration)
|
|
|
- y_pred_binary = [0 if i <= 0.164189 else 1 for i in list(y_pred)]
|
|
|
+ y_pred_binary = [0 if i <= 0.147637 else 1 for i in list(y_pred)]
|
|
|
# 转换为二进制输出
|
|
|
score_list = []
|
|
|
for index, item in enumerate(list(y_pred)):
|