From 7d5def2d203d6382a5db1ec9c83c309350568dfd Mon Sep 17 00:00:00 2001 From: kimtaesoo7 Date: Fri, 27 Sep 2024 16:06:19 +0900 Subject: [PATCH] =?UTF-8?q?Refactor:=20Result=20=EC=BB=AC=EB=9F=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=20-=20S11P21S002-223?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/model/entity/dto/TrainResponse.java | 2 ++ .../com/worlabel/domain/result/entity/Result.java | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/com/worlabel/domain/model/entity/dto/TrainResponse.java b/backend/src/main/java/com/worlabel/domain/model/entity/dto/TrainResponse.java index ffc118e..1ce1b92 100644 --- a/backend/src/main/java/com/worlabel/domain/model/entity/dto/TrainResponse.java +++ b/backend/src/main/java/com/worlabel/domain/model/entity/dto/TrainResponse.java @@ -19,4 +19,6 @@ public class TrainResponse { private double mAP5095; private double fitness; + + private double accuracy; } diff --git a/backend/src/main/java/com/worlabel/domain/result/entity/Result.java b/backend/src/main/java/com/worlabel/domain/result/entity/Result.java index 9f68042..5c4a2a4 100644 --- a/backend/src/main/java/com/worlabel/domain/result/entity/Result.java +++ b/backend/src/main/java/com/worlabel/domain/result/entity/Result.java @@ -63,6 +63,9 @@ public class Result extends BaseEntity { @Enumerated(EnumType.STRING) private Optimizer optimizer; + @Column(name = "accuracy", nullable = false) + private double accuracy; + public Result(final AiModel aiModel, final double precision, final double recall, @@ -74,7 +77,8 @@ public class Result extends BaseEntity { final double batch, final double lr0, final double lrf, - final Optimizer optimizer) { + final Optimizer optimizer, + final double accuracy) { this.aiModel = aiModel; this.precision = precision; this.recall = recall; @@ -87,9 +91,10 @@ public class Result extends BaseEntity { this.lr0 = lr0; this.lrf = lrf; this.optimizer = optimizer; + this.accuracy = accuracy; } - public static Result of(final AiModel aiModel,final TrainResponse trainResponse,final ModelTrainRequest trainRequest) { + public static Result of(final AiModel aiModel, final TrainResponse trainResponse, final ModelTrainRequest trainRequest) { return new Result(aiModel, trainResponse.getPrecision(), trainResponse.getRecall(), @@ -101,7 +106,8 @@ public class Result extends BaseEntity { trainRequest.getBatch(), trainRequest.getLr0(), trainRequest.getLrf(), - trainRequest.getOptimizer() - ); + trainRequest.getOptimizer(), + trainResponse.getAccuracy() + ); } }