Browse Source

仅通过标题tag 分析全部数据

罗俊辉 1 year ago
parent
commit
5a48d96e48
1 changed files with 3 additions and 3 deletions
  1. 3 3
      main.py

+ 3 - 3
main.py

@@ -140,9 +140,9 @@ class LightGBM(object):
         bst = lgb.Booster(model_file=self.model)
         y_pred = bst.predict(x, num_iteration=bst.best_iteration)
         pred_score_df = pd.DataFrame(list(y_pred), columns=['pred_score'])
-        # temp = sorted(list(y_pred))
-        # yuzhi = temp[int(len(temp) * 0.9) - 1]
-        y_pred_binary = [0 if i <= 0.169541 else 1 for i in list(y_pred)]
+        temp = sorted(list(y_pred))
+        yuzhi = temp[int(len(temp) * 0.75) - 1]
+        y_pred_binary = [0 if i <= yuzhi else 1 for i in list(y_pred)]
         pred_label_df = pd.DataFrame(list(y_pred_binary), columns=['pred_label'])
         score_list = []
         for index, item in enumerate(list(y_pred)):