|
|
|
@@ -1137,24 +1137,33 @@ public class ModelsServiceImpl implements ModelsService { |
|
|
|
|
|
|
|
void getMetrics(ModelMetaVo modelMetaVo) throws Exception { |
|
|
|
HashMap<String, Object> result = new HashMap<>(); |
|
|
|
HashMap<String, Object> train = new HashMap<>(); |
|
|
|
HashMap<String, Object> evaluate = new HashMap<>(); |
|
|
|
|
|
|
|
HashMap<String, Object> metrics = modelMetaVo.getMetrics(); |
|
|
|
JSONArray trainMetrics = (JSONArray) metrics.get("train"); |
|
|
|
for (int i = 0; i < trainMetrics.size(); i++) { |
|
|
|
JSONObject jsonObject = trainMetrics.getJSONObject(i); |
|
|
|
String runId = jsonObject.getString("run_id"); |
|
|
|
List<InsMetricInfoVo> expTrainInfos = aimsService.getExpTrainInfos(modelMetaVo.getTrainTask().getExperimentId(), runId); |
|
|
|
System.out.print(expTrainInfos); |
|
|
|
for (InsMetricInfoVo expTrainInfo :expTrainInfos) { |
|
|
|
for (InsMetricInfoVo expTrainInfo : expTrainInfos) { |
|
|
|
Map metrics1 = expTrainInfo.getMetrics(); |
|
|
|
train.putAll(metrics1); |
|
|
|
} |
|
|
|
} |
|
|
|
result.put("train", train); |
|
|
|
|
|
|
|
JSONArray testMetrics = (JSONArray) metrics.get("evaluate"); |
|
|
|
for (int i = 0; i < testMetrics.size(); i++) { |
|
|
|
JSONObject jsonObject = testMetrics.getJSONObject(i); |
|
|
|
String runId = jsonObject.getString("run_id"); |
|
|
|
List<InsMetricInfoVo> expTestInfos = aimsService.getExpEvaluateInfos(modelMetaVo.getTrainTask().getExperimentId(), runId); |
|
|
|
System.out.print(expTestInfos); |
|
|
|
for (InsMetricInfoVo expTestInfo : expTestInfos) { |
|
|
|
Map metrics1 = expTestInfo.getMetrics(); |
|
|
|
evaluate.putAll(metrics1); |
|
|
|
} |
|
|
|
} |
|
|
|
result.put("evaluate", evaluate); |
|
|
|
modelMetaVo.setMetrics(result); |
|
|
|
} |
|
|
|
} |