瀏覽代碼

修复xgb预测限制

jch 3 月之前
父節點
當前提交
8777de63ff

+ 1 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/score/model/XGBRegressionModel.java

@@ -50,7 +50,7 @@ public class XGBRegressionModel extends Model {
                 values[i] = v;
             }
             DMatrix dm = new DMatrix(values, 1, features.length, 0.0f);
-            float[][] result = model._booster().predict(dm, false, 100);
+            float[][] result = model._booster().predict(dm, false, 0);
             return result[0][0];
         } catch (Exception e) {
             return 0f;

+ 1 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/score/model/XGBoostModel.java

@@ -52,7 +52,7 @@ public class XGBoostModel extends Model {
                 values[i] = v;
             }
             DMatrix dm = new DMatrix(values, 1, features.length, 0.0f);
-            float[][] result = model._booster().predict(dm, false, 100);
+            float[][] result = model._booster().predict(dm, false, 0);
             return result[0][0];
         } catch (Exception e) {
             return 0f;