| @@ -5,6 +5,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.common.core.web.domain.GenericsAjaxResult; | import com.ruoyi.common.core.web.domain.GenericsAjaxResult; | ||||
| import com.ruoyi.platform.domain.AutoMl; | import com.ruoyi.platform.domain.AutoMl; | ||||
| import com.ruoyi.platform.service.AutoMLService; | import com.ruoyi.platform.service.AutoMLService; | ||||
| import com.ruoyi.platform.vo.AutoMlVo; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.data.domain.Page; | import org.springframework.data.domain.Page; | ||||
| @@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*; | |||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| import java.io.IOException; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("autoML") | @RequestMapping("autoML") | ||||
| @@ -33,18 +35,18 @@ public class AutoMLController extends BaseController { | |||||
| @PostMapping | @PostMapping | ||||
| @ApiOperation("新增自动机器学习") | @ApiOperation("新增自动机器学习") | ||||
| public GenericsAjaxResult<AutoMl> addAutoMl(@RequestBody AutoMl autoMl) throws Exception { | |||||
| return genericsSuccess(this.autoMLService.save(autoMl)); | |||||
| public GenericsAjaxResult<AutoMl> addAutoMl(@RequestBody AutoMlVo autoMlVo) throws Exception { | |||||
| return genericsSuccess(this.autoMLService.save(autoMlVo)); | |||||
| } | } | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑自动机器学习") | @ApiOperation("编辑自动机器学习") | ||||
| public GenericsAjaxResult<String> editAutoMl(@RequestBody AutoMl autoMl) throws Exception { | |||||
| return genericsSuccess(this.autoMLService.edit(autoMl)); | |||||
| public GenericsAjaxResult<String> editAutoMl(@RequestBody AutoMlVo autoMlVo) throws Exception { | |||||
| return genericsSuccess(this.autoMLService.edit(autoMlVo)); | |||||
| } | } | ||||
| @GetMapping("/getAutoMlDetail") | @GetMapping("/getAutoMlDetail") | ||||
| @ApiOperation("获取自动机器学习详细信息") | @ApiOperation("获取自动机器学习详细信息") | ||||
| public GenericsAjaxResult<AutoMl> getAutoMlDetail(@RequestParam("id") Long id){ | |||||
| public GenericsAjaxResult<AutoMlVo> getAutoMlDetail(@RequestParam("id") Long id) throws IOException { | |||||
| return genericsSuccess(this.autoMLService.getAutoMlDetail(id)); | return genericsSuccess(this.autoMLService.getAutoMlDetail(id)); | ||||
| } | } | ||||
| @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.Map; | |||||
| @Data | @Data | ||||
| @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) | @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) | ||||
| @@ -25,9 +26,6 @@ public class AutoMl { | |||||
| @ApiModelProperty(value = "任务类型:classification或regression") | @ApiModelProperty(value = "任务类型:classification或regression") | ||||
| private String taskType; | private String taskType; | ||||
| @ApiModelProperty(value = "数据集名称") | |||||
| private String datasetName; | |||||
| @ApiModelProperty(value = "搜索合适模型的时间限制(以秒为单位)。通过增加这个值,auto-sklearn有更高的机会找到更好的模型。默认3600,非必传。") | @ApiModelProperty(value = "搜索合适模型的时间限制(以秒为单位)。通过增加这个值,auto-sklearn有更高的机会找到更好的模型。默认3600,非必传。") | ||||
| private Integer timeLeftForThisTask; | private Integer timeLeftForThisTask; | ||||
| @@ -128,9 +126,6 @@ public class AutoMl { | |||||
| @ApiModelProperty(value = "文件夹存放配置输出和日志文件,默认/tmp/automl") | @ApiModelProperty(value = "文件夹存放配置输出和日志文件,默认/tmp/automl") | ||||
| private String tmpFolder; | private String tmpFolder; | ||||
| @ApiModelProperty(value = "数据集csv文件路径") | |||||
| private String dataCsv; | |||||
| @ApiModelProperty(value = "数据集csv文件中哪几列是预测目标列,逗号分隔") | @ApiModelProperty(value = "数据集csv文件中哪几列是预测目标列,逗号分隔") | ||||
| private String targetColumns; | private String targetColumns; | ||||
| @@ -182,6 +177,6 @@ public class AutoMl { | |||||
| private Date updateTime; | private Date updateTime; | ||||
| @TableField(exist = false) | |||||
| private VersionVo versionVo; | |||||
| private String dataset; | |||||
| } | } | ||||
| @@ -1,22 +1,24 @@ | |||||
| package com.ruoyi.platform.service; | package com.ruoyi.platform.service; | ||||
| import com.ruoyi.platform.domain.AutoMl; | import com.ruoyi.platform.domain.AutoMl; | ||||
| import com.ruoyi.platform.vo.AutoMlVo; | |||||
| import org.springframework.data.domain.Page; | import org.springframework.data.domain.Page; | ||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| import java.io.IOException; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| public interface AutoMLService { | public interface AutoMLService { | ||||
| Page<AutoMl> queryByPage(String mlName, PageRequest pageRequest); | Page<AutoMl> queryByPage(String mlName, PageRequest pageRequest); | ||||
| AutoMl save(AutoMl autoMl) throws Exception; | |||||
| AutoMl save(AutoMlVo autoMlVo) throws Exception; | |||||
| String edit(AutoMl autoMl) throws Exception; | |||||
| String edit(AutoMlVo autoMlVo) throws Exception; | |||||
| String delete(Long id); | String delete(Long id); | ||||
| AutoMl getAutoMlDetail(Long id); | |||||
| AutoMlVo getAutoMlDetail(Long id) throws IOException; | |||||
| Map<String, String> upload(MultipartFile file, String uuid) throws Exception; | Map<String, String> upload(MultipartFile file, String uuid) throws Exception; | ||||
| @@ -5,14 +5,14 @@ import com.ruoyi.platform.constant.Constant; | |||||
| import com.ruoyi.platform.domain.AutoMl; | import com.ruoyi.platform.domain.AutoMl; | ||||
| import com.ruoyi.platform.mapper.AutoMLDao; | import com.ruoyi.platform.mapper.AutoMLDao; | ||||
| import com.ruoyi.platform.service.AutoMLService; | import com.ruoyi.platform.service.AutoMLService; | ||||
| import com.ruoyi.platform.utils.DVCUtils; | |||||
| import com.ruoyi.platform.utils.FileUtil; | |||||
| import com.ruoyi.platform.utils.K8sClientUtil; | |||||
| import com.ruoyi.platform.utils.*; | |||||
| import com.ruoyi.platform.vo.AutoMlVo; | |||||
| import io.kubernetes.client.openapi.models.V1Pod; | import io.kubernetes.client.openapi.models.V1Pod; | ||||
| import org.apache.commons.io.FileUtils; | import org.apache.commons.io.FileUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.BeanUtils; | |||||
| import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.data.domain.Page; | import org.springframework.data.domain.Page; | ||||
| import org.springframework.data.domain.PageImpl; | import org.springframework.data.domain.PageImpl; | ||||
| @@ -22,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile; | |||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | |||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -59,39 +60,35 @@ public class AutoMLServiceImpl implements AutoMLService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public AutoMl save(AutoMl autoMl) throws Exception { | |||||
| AutoMl autoMlByName = autoMLDao.getAutoMlByName(autoMl.getMlName()); | |||||
| public AutoMl save(AutoMlVo autoMlVo) throws Exception { | |||||
| AutoMl autoMlByName = autoMLDao.getAutoMlByName(autoMlVo.getMlName()); | |||||
| if (autoMlByName != null) { | if (autoMlByName != null) { | ||||
| throw new RuntimeException("实验名称已存在"); | throw new RuntimeException("实验名称已存在"); | ||||
| } | } | ||||
| AutoMl autoMl = new AutoMl(); | |||||
| BeanUtils.copyProperties(autoMlVo, autoMl); | |||||
| String username = SecurityUtils.getLoginUser().getUsername(); | String username = SecurityUtils.getLoginUser().getUsername(); | ||||
| autoMl.setCreateBy(username); | autoMl.setCreateBy(username); | ||||
| autoMl.setUpdateBy(username); | autoMl.setUpdateBy(username); | ||||
| String sourcePath = autoMl.getVersionVo().getUrl(); | |||||
| String rootPath = localPath + username + "/automl/" + autoMl.getMlName() + "/" + autoMl.getDatasetName(); | |||||
| dvcUtils.moveFiles(sourcePath, rootPath); | |||||
| autoMl.setDataCsv(rootPath + "/" + autoMl.getVersionVo().getFileName()); | |||||
| String datasetJson = JacksonUtil.toJSONString(autoMlVo.getDataset()); | |||||
| autoMl.setDataset(datasetJson); | |||||
| autoMLDao.save(autoMl); | autoMLDao.save(autoMl); | ||||
| return autoMl; | return autoMl; | ||||
| } | } | ||||
| @Override | @Override | ||||
| public String edit(AutoMl autoMl) throws Exception { | |||||
| AutoMl oldAutoMl = autoMLDao.getAutoMlByName(autoMl.getMlName()); | |||||
| if (oldAutoMl != null && !oldAutoMl.getId().equals(autoMl.getId())) { | |||||
| public String edit(AutoMlVo autoMlVo) throws Exception { | |||||
| AutoMl oldAutoMl = autoMLDao.getAutoMlByName(autoMlVo.getMlName()); | |||||
| if (oldAutoMl != null && !oldAutoMl.getId().equals(autoMlVo.getId())) { | |||||
| throw new RuntimeException("实验名称已存在"); | throw new RuntimeException("实验名称已存在"); | ||||
| } | } | ||||
| String username = SecurityUtils.getLoginUser().getUsername(); | |||||
| AutoMl autoMl = new AutoMl(); | |||||
| BeanUtils.copyProperties(autoMlVo, autoMl); | |||||
| // String username = SecurityUtils.getLoginUser().getUsername(); | |||||
| String username = "admin"; | |||||
| autoMl.setUpdateBy(username); | autoMl.setUpdateBy(username); | ||||
| if (autoMl.getVersionVo() != null && StringUtils.isNotEmpty(autoMl.getVersionVo().getUrl())) { | |||||
| String sourcePath = autoMl.getVersionVo().getUrl(); | |||||
| String rootPath = localPath + username + "/automl/" + autoMl.getMlName() + "/" + autoMl.getDatasetName(); | |||||
| dvcUtils.moveFiles(sourcePath, rootPath); | |||||
| autoMl.setDataCsv(rootPath + "/" + autoMl.getVersionVo().getFileName()); | |||||
| } | |||||
| String datasetJson = JacksonUtil.toJSONString(autoMlVo.getDataset()); | |||||
| autoMl.setDataset(datasetJson); | |||||
| autoMLDao.edit(autoMl); | autoMLDao.edit(autoMl); | ||||
| return "修改成功"; | return "修改成功"; | ||||
| @@ -104,8 +101,7 @@ public class AutoMLServiceImpl implements AutoMLService { | |||||
| throw new RuntimeException("服务不存在"); | throw new RuntimeException("服务不存在"); | ||||
| } | } | ||||
| // String username = SecurityUtils.getLoginUser().getUsername(); | |||||
| String username = "admin"; | |||||
| String username = SecurityUtils.getLoginUser().getUsername(); | |||||
| String createBy = autoMl.getCreateBy(); | String createBy = autoMl.getCreateBy(); | ||||
| if (!(StringUtils.equals(username, "admin") || StringUtils.equals(username, createBy))) { | if (!(StringUtils.equals(username, "admin") || StringUtils.equals(username, createBy))) { | ||||
| throw new RuntimeException("无权限删除该服务"); | throw new RuntimeException("无权限删除该服务"); | ||||
| @@ -116,8 +112,14 @@ public class AutoMLServiceImpl implements AutoMLService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public AutoMl getAutoMlDetail(Long id) { | |||||
| return autoMLDao.getAutoMlById(id); | |||||
| public AutoMlVo getAutoMlDetail(Long id) throws IOException { | |||||
| AutoMl autoMl = autoMLDao.getAutoMlById(id); | |||||
| AutoMlVo autoMlVo = new AutoMlVo(); | |||||
| BeanUtils.copyProperties(autoMl, autoMlVo); | |||||
| if (StringUtils.isNotEmpty(autoMl.getDataset())) { | |||||
| autoMlVo.setDataset(JsonUtils.jsonToMap(autoMl.getDataset())); | |||||
| } | |||||
| return autoMlVo; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -151,21 +153,11 @@ public class AutoMLServiceImpl implements AutoMLService { | |||||
| StringBuffer command = new StringBuffer(); | StringBuffer command = new StringBuffer(); | ||||
| command.append("nohup python /opt/automl.py --task_type " + autoMl.getTaskType()); | command.append("nohup python /opt/automl.py --task_type " + autoMl.getTaskType()); | ||||
| if (StringUtils.isNotEmpty(autoMl.getDataCsv())) { | |||||
| command.append(" --data_csv " + autoMl.getDataCsv()); | |||||
| } else { | |||||
| throw new Exception("训练数据为空"); | |||||
| } | |||||
| if (StringUtils.isNotEmpty(autoMl.getTargetColumns())) { | if (StringUtils.isNotEmpty(autoMl.getTargetColumns())) { | ||||
| command.append(" --target_columns " + autoMl.getTargetColumns()); | command.append(" --target_columns " + autoMl.getTargetColumns()); | ||||
| } else { | } else { | ||||
| throw new Exception("目标列为空"); | throw new Exception("目标列为空"); | ||||
| } | } | ||||
| if (StringUtils.isNotEmpty(autoMl.getDatasetName())) { | |||||
| command.append(" --dataset_name " + autoMl.getDatasetName()); | |||||
| } else { | |||||
| throw new Exception("数据集名称为空"); | |||||
| } | |||||
| // String username = SecurityUtils.getLoginUser().getUsername().toLowerCase(); | // String username = SecurityUtils.getLoginUser().getUsername().toLowerCase(); | ||||
| String username = "admin"; | String username = "admin"; | ||||
| @@ -0,0 +1,183 @@ | |||||
| package com.ruoyi.platform.vo; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.fasterxml.jackson.databind.PropertyNamingStrategy; | |||||
| import com.fasterxml.jackson.databind.annotation.JsonNaming; | |||||
| import io.swagger.annotations.ApiModel; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import java.util.Date; | |||||
| import java.util.Map; | |||||
| @Data | |||||
| @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) | |||||
| @ApiModel(description = "自动机器学习") | |||||
| public class AutoMlVo { | |||||
| private Long id; | |||||
| @ApiModelProperty(value = "实验名称") | |||||
| private String mlName; | |||||
| @ApiModelProperty(value = "实验描述") | |||||
| private String mlDescription; | |||||
| @ApiModelProperty(value = "任务类型:classification或regression") | |||||
| private String taskType; | |||||
| @ApiModelProperty(value = "搜索合适模型的时间限制(以秒为单位)。通过增加这个值,auto-sklearn有更高的机会找到更好的模型。默认3600,非必传。") | |||||
| private Integer timeLeftForThisTask; | |||||
| @ApiModelProperty(value = "单次调用机器学习模型的时间限制(以秒为单位)。如果机器学习算法运行超过时间限制,将终止模型拟合。将这个值设置得足够高,这样典型的机器学习算法就可以适用于训练数据。默认600,非必传。") | |||||
| private Integer perRunTimeLimit; | |||||
| @ApiModelProperty(value = "集成模型数量,如果设置为0,则没有集成。默认50,非必传。") | |||||
| private Integer ensembleSize; | |||||
| @ApiModelProperty(value = "设置为None将禁用集成构建,设置为SingleBest仅使用单个最佳模型而不是集成,设置为default,它将对单目标问题使用EnsembleSelection,对多目标问题使用MultiObjectiveDummyEnsemble。默认default,非必传。") | |||||
| private String ensembleClass; | |||||
| @ApiModelProperty(value = "在构建集成时只考虑ensemble_nbest模型。这是受到了“最大限度地利用集成选择”中引入的库修剪概念的启发。这是独立于ensemble_class参数的,并且这个修剪步骤是在构造集成之前完成的。默认50,非必传。") | |||||
| private Integer ensembleNbest; | |||||
| @ApiModelProperty(value = "定义在磁盘中保存的模型的最大数量。额外的模型数量将被永久删除。由于这个变量的性质,它设置了一个集成可以使用多少个模型的上限。必须是大于等于1的整数。如果设置为None,则所有模型都保留在磁盘上。默认50,非必传。") | |||||
| private Integer maxModelsOnDisc; | |||||
| @ApiModelProperty(value = "随机种子,将决定输出文件名。默认1,非必传。") | |||||
| private Integer seed; | |||||
| @ApiModelProperty(value = "机器学习算法的内存限制(MB)。如果auto-sklearn试图分配超过memory_limit MB,它将停止拟合机器学习算法。默认3072,非必传。") | |||||
| private Integer memoryLimit; | |||||
| @ApiModelProperty(value = "如果为None,则使用所有可能的分类算法。否则,指定搜索中包含的步骤和组件。有关可用组件,请参见/pipeline/components/<step>/*。与参数exclude不兼容。多选,逗号分隔。包含:adaboost\n" + | |||||
| "bernoulli_nb\n" + | |||||
| "decision_tree\n" + | |||||
| "extra_trees\n" + | |||||
| "gaussian_nb\n" + | |||||
| "gradient_boosting\n" + | |||||
| "k_nearest_neighbors\n" + | |||||
| "lda\n" + | |||||
| "liblinear_svc\n" + | |||||
| "libsvm_svc\n" + | |||||
| "mlp\n" + | |||||
| "multinomial_nb\n" + | |||||
| "passive_aggressive\n" + | |||||
| "qda\n" + | |||||
| "random_forest\n" + | |||||
| "sgd") | |||||
| private String includeClassifier; | |||||
| @ApiModelProperty(value = "如果为None,则使用所有可能的特征预处理算法。否则,指定搜索中包含的步骤和组件。有关可用组件,请参见/pipeline/components/<step>/*。与参数exclude不兼容。多选,逗号分隔。包含:densifier\n" + | |||||
| "extra_trees_preproc_for_classification\n" + | |||||
| "extra_trees_preproc_for_regression\n" + | |||||
| "fast_ica\n" + | |||||
| "feature_agglomeration\n" + | |||||
| "kernel_pca\n" + | |||||
| "kitchen_sinks\n" + | |||||
| "liblinear_svc_preprocessor\n" + | |||||
| "no_preprocessing\n" + | |||||
| "nystroem_sampler\n" + | |||||
| "pca\n" + | |||||
| "polynomial\n" + | |||||
| "random_trees_embedding\n" + | |||||
| "select_percentile_classification\n" + | |||||
| "select_percentile_regression\n" + | |||||
| "select_rates_classification\n" + | |||||
| "select_rates_regression\n" + | |||||
| "truncatedSVD") | |||||
| private String includeFeaturePreprocessor; | |||||
| @ApiModelProperty(value = "如果为None,则使用所有可能的回归算法。否则,指定搜索中包含的步骤和组件。有关可用组件,请参见/pipeline/components/<step>/*。与参数exclude不兼容。多选,逗号分隔。包含:adaboost,\n" + | |||||
| "ard_regression,\n" + | |||||
| "decision_tree,\n" + | |||||
| "extra_trees,\n" + | |||||
| "gaussian_process,\n" + | |||||
| "gradient_boosting,\n" + | |||||
| "k_nearest_neighbors,\n" + | |||||
| "liblinear_svr,\n" + | |||||
| "libsvm_svr,\n" + | |||||
| "mlp,\n" + | |||||
| "random_forest,\n" + | |||||
| "sgd") | |||||
| private String includeRegressor; | |||||
| private String excludeClassifier; | |||||
| private String excludeRegressor; | |||||
| private String excludeFeaturePreprocessor; | |||||
| @ApiModelProperty(value = "测试集的比率,0到1之间") | |||||
| private Float testSize; | |||||
| @ApiModelProperty(value = "如何处理过拟合,如果使用基于“cv”的方法或Splitter对象,可能需要使用resampling_strategy_arguments。holdout或crossValid") | |||||
| private String resamplingStrategy; | |||||
| @ApiModelProperty(value = "重采样划分训练集和验证集,训练集的比率,0到1之间") | |||||
| private Float trainSize; | |||||
| @ApiModelProperty(value = "拆分数据前是否进行shuffle") | |||||
| private Boolean shuffle; | |||||
| @ApiModelProperty(value = "交叉验证的折数,当resamplingStrategy为crossValid时,此项必填,为整数") | |||||
| private Integer folds; | |||||
| @ApiModelProperty(value = "文件夹存放配置输出和日志文件,默认/tmp/automl") | |||||
| private String tmpFolder; | |||||
| @ApiModelProperty(value = "数据集csv文件中哪几列是预测目标列,逗号分隔") | |||||
| private String targetColumns; | |||||
| @ApiModelProperty(value = "自定义指标名称") | |||||
| private String metricName; | |||||
| @ApiModelProperty(value = "模型优化目标指标及权重,json格式。分类的指标包含:accuracy\n" + | |||||
| "balanced_accuracy\n" + | |||||
| "roc_auc\n" + | |||||
| "average_precision\n" + | |||||
| "log_loss\n" + | |||||
| "precision_macro\n" + | |||||
| "precision_micro\n" + | |||||
| "precision_samples\n" + | |||||
| "precision_weighted\n" + | |||||
| "recall_macro\n" + | |||||
| "recall_micro\n" + | |||||
| "recall_samples\n" + | |||||
| "recall_weighted\n" + | |||||
| "f1_macro\n" + | |||||
| "f1_micro\n" + | |||||
| "f1_samples\n" + | |||||
| "f1_weighted\n" + | |||||
| "回归的指标包含:mean_absolute_error\n" + | |||||
| "mean_squared_error\n" + | |||||
| "root_mean_squared_error\n" + | |||||
| "mean_squared_log_error\n" + | |||||
| "median_absolute_error\n" + | |||||
| "r2") | |||||
| private String metrics; | |||||
| @ApiModelProperty(value = "指标优化方向,是越大越好还是越小越好") | |||||
| private Boolean greaterIsBetter; | |||||
| @ApiModelProperty(value = "模型计算并打印指标") | |||||
| private String scoringFunctions; | |||||
| private Integer state; | |||||
| private String runState; | |||||
| private Double progress; | |||||
| private String createBy; | |||||
| private Date createTime; | |||||
| private String updateBy; | |||||
| private Date updateTime; | |||||
| /** | |||||
| * 对应数据集 | |||||
| */ | |||||
| private Map<String,Object> dataset; | |||||
| } | |||||
| @@ -2,23 +2,26 @@ | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.ruoyi.platform.mapper.AutoMLDao"> | <mapper namespace="com.ruoyi.platform.mapper.AutoMLDao"> | ||||
| <insert id="save"> | <insert id="save"> | ||||
| insert into auto_ml(ml_name, ml_description, task_type, dataset_name, time_left_for_this_task, | |||||
| insert into auto_ml(ml_name, ml_description, task_type, dataset, time_left_for_this_task, | |||||
| per_run_time_limit, ensemble_size, ensemble_class, ensemble_nbest, max_models_on_disc, seed, | per_run_time_limit, ensemble_size, ensemble_class, ensemble_nbest, max_models_on_disc, seed, | ||||
| memory_limit, | memory_limit, | ||||
| include_classifier, include_feature_preprocessor, include_regressor, exclude_classifier, | include_classifier, include_feature_preprocessor, include_regressor, exclude_classifier, | ||||
| exclude_regressor, exclude_feature_preprocessor, test_size, resampling_strategy, train_size, | exclude_regressor, exclude_feature_preprocessor, test_size, resampling_strategy, train_size, | ||||
| shuffle, folds, data_csv, target_columns, metric_name, metrics,greater_is_better,scoring_functions,tmp_folder, | |||||
| create_by,update_by) | |||||
| values (#{autoMl.mlName}, #{autoMl.mlDescription}, #{autoMl.taskType}, #{autoMl.datasetName}, | |||||
| shuffle, folds, target_columns, metric_name, metrics, greater_is_better, scoring_functions, | |||||
| tmp_folder, | |||||
| create_by, update_by) | |||||
| values (#{autoMl.mlName}, #{autoMl.mlDescription}, #{autoMl.taskType}, #{autoMl.dataset}, | |||||
| #{autoMl.timeLeftForThisTask}, #{autoMl.perRunTimeLimit}, | #{autoMl.timeLeftForThisTask}, #{autoMl.perRunTimeLimit}, | ||||
| #{autoMl.ensembleSize}, #{autoMl.ensembleClass}, #{autoMl.ensembleNbest}, | #{autoMl.ensembleSize}, #{autoMl.ensembleClass}, #{autoMl.ensembleNbest}, | ||||
| #{autoMl.maxModelsOnDisc}, #{autoMl.seed}, | #{autoMl.maxModelsOnDisc}, #{autoMl.seed}, | ||||
| #{autoMl.memoryLimit}, #{autoMl.includeClassifier}, #{autoMl.includeFeaturePreprocessor}, | #{autoMl.memoryLimit}, #{autoMl.includeClassifier}, #{autoMl.includeFeaturePreprocessor}, | ||||
| #{autoMl.includeRegressor}, #{autoMl.excludeClassifier}, | #{autoMl.includeRegressor}, #{autoMl.excludeClassifier}, | ||||
| #{autoMl.excludeRegressor}, #{autoMl.excludeFeaturePreprocessor}, #{autoMl.testSize}, #{autoMl.resamplingStrategy}, | |||||
| #{autoMl.excludeRegressor}, #{autoMl.excludeFeaturePreprocessor}, #{autoMl.testSize}, | |||||
| #{autoMl.resamplingStrategy}, | |||||
| #{autoMl.trainSize}, #{autoMl.shuffle}, | #{autoMl.trainSize}, #{autoMl.shuffle}, | ||||
| #{autoMl.folds}, #{autoMl.dataCsv}, | |||||
| #{autoMl.targetColumns}, #{autoMl.metricName}, #{autoMl.metrics},#{autoMl.greaterIsBetter},#{autoMl.scoringFunctions},#{autoMl.tmpFolder}, | |||||
| #{autoMl.folds}, | |||||
| #{autoMl.targetColumns}, #{autoMl.metricName}, #{autoMl.metrics}, #{autoMl.greaterIsBetter}, | |||||
| #{autoMl.scoringFunctions}, #{autoMl.tmpFolder}, | |||||
| #{autoMl.createBy}, #{autoMl.updateBy}) | #{autoMl.createBy}, #{autoMl.updateBy}) | ||||
| </insert> | </insert> | ||||
| @@ -40,8 +43,8 @@ | |||||
| <if test="autoMl.taskType != null and autoMl.taskType !=''"> | <if test="autoMl.taskType != null and autoMl.taskType !=''"> | ||||
| task_type = #{autoMl.taskType}, | task_type = #{autoMl.taskType}, | ||||
| </if> | </if> | ||||
| <if test="autoMl.datasetName != null and autoMl.datasetName !=''"> | |||||
| dataset_name = #{autoMl.datasetName}, | |||||
| <if test="autoMl.dataset != null and autoMl.dataset !=''"> | |||||
| dataset = #{autoMl.dataset}, | |||||
| </if> | </if> | ||||
| <if test="autoMl.timeLeftForThisTask != null"> | <if test="autoMl.timeLeftForThisTask != null"> | ||||
| time_left_for_this_task = #{autoMl.timeLeftForThisTask}, | time_left_for_this_task = #{autoMl.timeLeftForThisTask}, | ||||
| @@ -67,24 +70,13 @@ | |||||
| <if test="autoMl.memoryLimit != null"> | <if test="autoMl.memoryLimit != null"> | ||||
| memory_limit = #{autoMl.memoryLimit}, | memory_limit = #{autoMl.memoryLimit}, | ||||
| </if> | </if> | ||||
| <if test="autoMl.includeClassifier != null and autoMl.includeClassifier !=''"> | |||||
| include_classifier = #{autoMl.includeClassifier}, | |||||
| </if> | |||||
| <if test="autoMl.includeFeaturePreprocessor != null and autoMl.includeFeaturePreprocessor !=''"> | |||||
| include_feature_preprocessor = #{autoMl.includeFeaturePreprocessor}, | |||||
| </if> | |||||
| <if test="autoMl.includeRegressor != null and autoMl.includeRegressor !=''"> | |||||
| include_regressor = #{autoMl.includeRegressor}, | |||||
| </if> | |||||
| <if test="autoMl.excludeClassifier != null and autoMl.excludeClassifier !=''"> | |||||
| exclude_classifier = #{autoMl.excludeClassifier}, | |||||
| </if> | |||||
| <if test="autoMl.excludeRegressor != null and autoMl.excludeRegressor !=''"> | |||||
| exclude_regressor = #{autoMl.excludeRegressor}, | |||||
| </if> | |||||
| <if test="autoMl.excludeFeaturePreprocessor != null and autoMl.excludeFeaturePreprocessor !=''"> | |||||
| exclude_feature_preprocessor = #{autoMl.excludeFeaturePreprocessor}, | |||||
| </if> | |||||
| include_classifier = #{autoMl.includeClassifier}, | |||||
| include_feature_preprocessor = #{autoMl.includeFeaturePreprocessor}, | |||||
| include_regressor = #{autoMl.includeRegressor}, | |||||
| exclude_classifier = #{autoMl.excludeClassifier}, | |||||
| exclude_regressor = #{autoMl.excludeRegressor}, | |||||
| exclude_feature_preprocessor = #{autoMl.excludeFeaturePreprocessor}, | |||||
| scoring_functions = #{autoMl.scoringFunctions}, | |||||
| <if test="autoMl.testSize != null and autoMl.testSize !=''"> | <if test="autoMl.testSize != null and autoMl.testSize !=''"> | ||||
| test_size = #{autoMl.testSize}, | test_size = #{autoMl.testSize}, | ||||
| </if> | </if> | ||||
| @@ -100,9 +92,6 @@ | |||||
| <if test="autoMl.folds != null"> | <if test="autoMl.folds != null"> | ||||
| folds = #{autoMl.folds}, | folds = #{autoMl.folds}, | ||||
| </if> | </if> | ||||
| <if test="autoMl.dataCsv != null and autoMl.dataCsv !=''"> | |||||
| data_csv = #{autoMl.dataCsv}, | |||||
| </if> | |||||
| <if test="autoMl.tmpFolder != null and autoMl.tmpFolder !=''"> | <if test="autoMl.tmpFolder != null and autoMl.tmpFolder !=''"> | ||||
| tmp_folder = #{autoMl.tmpFolder}, | tmp_folder = #{autoMl.tmpFolder}, | ||||
| </if> | </if> | ||||
| @@ -112,12 +101,9 @@ | |||||
| <if test="autoMl.metrics != null and autoMl.metrics !=''"> | <if test="autoMl.metrics != null and autoMl.metrics !=''"> | ||||
| metrics = #{autoMl.metrics}, | metrics = #{autoMl.metrics}, | ||||
| </if> | </if> | ||||
| <if test="autoMl.greater_is_better != null"> | |||||
| <if test="autoMl.greaterIsBetter != null"> | |||||
| greater_is_better = #{autoMl.greaterIsBetter}, | greater_is_better = #{autoMl.greaterIsBetter}, | ||||
| </if> | </if> | ||||
| <if test="autoMl.scoringFunctions != null and autoMl.scoringFunctions !=''"> | |||||
| scoring_functions = #{autoMl.scoringFunctions}, | |||||
| </if> | |||||
| <if test="autoMl.targetColumns != null and autoMl.targetColumns !=''"> | <if test="autoMl.targetColumns != null and autoMl.targetColumns !=''"> | ||||
| target_columns = #{autoMl.targetColumns}, | target_columns = #{autoMl.targetColumns}, | ||||
| </if> | </if> | ||||