Roc 2 dienas atpakaļ
vecāks
revīzija
b27b8b3b53

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

@@ -1462,7 +1462,3 @@ func getAllSearchDataSource(keyword string, source, subSource int) (list []*data
 
 	return
 }
-
-//func init() {
-//	services.AddIndexTaskToCache(1, `ai_predict_model_run`)
-//}

+ 2 - 2
models/ai_predict_model/request/index_config.go

@@ -15,7 +15,7 @@ type TrainReq struct {
 // ConfigParams
 // @Description: 训练参数
 type ConfigParams struct {
-	Seed            float64 `json:"seed" description:"随机种子,如:42"`
+	Seed            int     `json:"seed" description:"随机种子,如:42"`
 	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"`
@@ -23,7 +23,7 @@ type ConfigParams struct {
 	NumBoostRound   int     `json:"num_boost_round" description:"迭代次数;正整数,必须大于0"`
 	LearningRate    float64 `json:"learning_rate" description:"学习率,如:0.0881"`
 	MaxDepth        int     `json:"max_depth" description:"最大深度(控制树的深度,防止过拟合),如:4;正整数,必须大于0"`
-	MinChildWeight  float64 `json:"min_child_weight" description:"最小子节点权重(防止过拟合),如:6.0601"`
+	MinChildWeight  int     `json:"min_child_weight" description:"最小子节点权重(防止过拟合),如:6.0601"`
 	Subsample       float64 `json:"subsample" description:"随机采样(防止过拟合),如:0.9627"`
 	ColsampleBytree float64 `json:"colsample_bytree" description:"特征随机采样(防止过拟合),如:0.7046"`
 	Gamma           float64 `json:"gamma" description:"控制分裂,如:0.4100"`

+ 10 - 0
utils/common.go

@@ -2905,6 +2905,16 @@ func GetExcelDate(strDate string) (newDate time.Time, err error) {
 		return
 	}
 
+	newDate, _ = time.ParseInLocation(FormatDate, strDate, time.Local)
+	if !newDate.IsZero() {
+		return
+	}
+
+	newDate, _ = time.ParseInLocation(FormatDateUnSpace, strDate, time.Local)
+	if !newDate.IsZero() {
+		return
+	}
+
 	//可能是excel的日期格式
 	_, tmpErr := strconv.Atoi(strDate)
 	if tmpErr != nil {