Roc 1 月之前
父节点
当前提交
5566f3f26f
共有 2 个文件被更改,包括 11 次插入5 次删除
  1. 5 0
      controllers/data_manage/ai_predict_model/index.go
  2. 6 5
      models/ai_predict_model/request/index_config.go

+ 5 - 0
controllers/data_manage/ai_predict_model/index.go

@@ -1377,9 +1377,14 @@ func (this *AiPredictModelIndexController) Run() {
 
 
 	indexIdList := make([]int, 0)
 	indexIdList := make([]int, 0)
 	for _, v := range list {
 	for _, v := range list {
+		// 没有配置python脚本路径
 		if v.ScriptPath == `` {
 		if v.ScriptPath == `` {
 			continue
 			continue
 		}
 		}
+		// 没有配置默认参数
+		if v.AiPredictModelIndexConfigId <= 0 {
+			continue
+		}
 		indexIdList = append(indexIdList, v.AiPredictModelIndexId)
 		indexIdList = append(indexIdList, v.AiPredictModelIndexId)
 	}
 	}
 
 

+ 6 - 5
models/ai_predict_model/request/index_config.go

@@ -15,7 +15,12 @@ type TrainReq struct {
 // ConfigParams
 // ConfigParams
 // @Description: 训练参数
 // @Description: 训练参数
 type ConfigParams struct {
 type ConfigParams struct {
+	Seed            float64 `json:"seed" description:"随机种子,如:42"`
 	Objective       string  `json:"objective" description:"目标(回归任务),枚举值,squarederror、multi、sofamax;默认值:squarederror" `
 	Objective       string  `json:"objective" description:"目标(回归任务),枚举值,squarederror、multi、sofamax;默认值:squarederror" `
+	EvalMetric      string  `json:"eval_metric" description:"评估指标,枚举值,rmse、auc logloss、merror;默认值:rmse"`
+	MaxDeltaStep    int     `json:"max_delta_step" description:"最大步长,如:5;正整数,必须大于0"`
+	TreeMethod      string  `json:"tree_method" description:"树构建方法,枚举值:auto、exact、approx、hist;默认值:auto"`
+	NumBoostRound   int     `json:"num_boost_round" description:"迭代次数;正整数,必须大于0"`
 	LearningRate    float64 `json:"learning_rate" description:"学习率,如:0.0881"`
 	LearningRate    float64 `json:"learning_rate" description:"学习率,如:0.0881"`
 	MaxDepth        int     `json:"max_depth" description:"最大深度(控制树的深度,防止过拟合),如:4;正整数,必须大于0"`
 	MaxDepth        int     `json:"max_depth" description:"最大深度(控制树的深度,防止过拟合),如:4;正整数,必须大于0"`
 	MinChildWeight  float64 `json:"min_child_weight" description:"最小子节点权重(防止过拟合),如:6.0601"`
 	MinChildWeight  float64 `json:"min_child_weight" description:"最小子节点权重(防止过拟合),如:6.0601"`
@@ -24,9 +29,5 @@ type ConfigParams struct {
 	Gamma           float64 `json:"gamma" description:"控制分裂,如:0.4100"`
 	Gamma           float64 `json:"gamma" description:"控制分裂,如:0.4100"`
 	RegAlpha        float64 `json:"reg_alpha" description:"L1正则化系数,如:0.3738"`
 	RegAlpha        float64 `json:"reg_alpha" description:"L1正则化系数,如:0.3738"`
 	ReqLambda       float64 `json:"reg_lambda" description:"L2正则化系数,如:1.4775"`
 	ReqLambda       float64 `json:"reg_lambda" description:"L2正则化系数,如:1.4775"`
-	EvalMetric      string  `json:"eval_metric" description:"评估指标,枚举值,rmse、auc logloss、merror;默认值:rmse"`
-	Seed            float64 `json:"seed" description:"随机种子,如:42"`
-	MaxDeltaStep    int     `json:"max_delta_step" description:"最大步长,如:5;正整数,必须大于0"`
-	TreeMethod      string  `json:"tree_method" description:"树构建方法,枚举值:auto、exact、approx、hist;默认值:auto"`
-	NumBoostRound   int     `json:"num_boost_round" description:"迭代次数;正整数,必须大于0"`
+	Booster         string  `json:"booster" description:"使用哪种补充包。可以是,或;使用基于树的模型,同时使用线性函数。枚举值:gbtree、gblinear、dart、gbtree、dart、gblinear"`
 }
 }