Refactor: Result 컬럼 추가 - S11P21S002-223

This commit is contained in:
kimtaesoo7 2024-09-27 16:06:19 +09:00
parent ffe79cc79b
commit 7d5def2d20
2 changed files with 12 additions and 4 deletions

View File

@ -19,4 +19,6 @@ public class TrainResponse {
private double mAP5095;
private double fitness;
private double accuracy;
}

View File

@ -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()
);
}
}