임시 데이터셋 폴더 생성 G4 추가

This commit is contained in:
2026-04-02 18:04:41 +09:00
parent 71d9835b03
commit e93f533c59
5 changed files with 118 additions and 40 deletions

View File

@@ -14,7 +14,7 @@ import lombok.Setter;
public class HyperParam {
@Schema(description = "모델", example = "G1")
private ModelType model; // G1, G2, G3
private ModelType model; // G1, G2, G3, G4
// -------------------------
// Important

View File

@@ -101,7 +101,7 @@ public class HyperParamApiController {
LocalDate endDate,
@Parameter(description = "버전명", example = "G1_000019") @RequestParam(required = false)
String hyperVer,
@Parameter(description = "모델 타입 (G1, G2, G3 중 하나)", example = "G1")
@Parameter(description = "모델 타입 (G1, G2, G3, G4 중 하나)", example = "G1")
@RequestParam(required = false)
ModelType model,
@Parameter(

View File

@@ -69,7 +69,7 @@ public class ModelTrainMngApiController {
@Parameter(
description = "모델",
example = "G1",
schema = @Schema(allowableValues = {"G1", "G2", "G3"}))
schema = @Schema(allowableValues = {"G1", "G2", "G3", "G4"}))
@RequestParam(required = false)
String modelNo,
@Parameter(description = "페이지 번호") @RequestParam(defaultValue = "0") int page,

View File

@@ -522,9 +522,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
dataset.targetYyyy,
dataset.memo,
new CaseBuilder()
.when(
datasetObjEntity.targetClassCd.equalsIgnoreCase(
DetectionClassification.SOLAR.getId()))
.when(datasetObjEntity.targetClassCd.eq(DetectionClassification.SOLAR.getId()))
.then(1)
.otherwise(0)
.sum()))

View File

@@ -1,9 +1,11 @@
package com.kamco.cd.training.postgres.repository.model;
import static com.kamco.cd.training.postgres.entity.QDatasetEntity.datasetEntity;
import static com.kamco.cd.training.postgres.entity.QDatasetObjEntity.datasetObjEntity;
import static com.kamco.cd.training.postgres.entity.QModelDatasetMappEntity.modelDatasetMappEntity;
import static com.kamco.cd.training.postgres.entity.QModelMasterEntity.modelMasterEntity;
import com.kamco.cd.training.common.enums.DetectionClassification;
import com.kamco.cd.training.common.enums.ModelType;
import com.kamco.cd.training.postgres.entity.ModelDatasetMappEntity;
import com.kamco.cd.training.postgres.entity.QDatasetObjEntity;
@@ -11,6 +13,7 @@ import com.kamco.cd.training.postgres.entity.QDatasetTestObjEntity;
import com.kamco.cd.training.postgres.entity.QDatasetValObjEntity;
import com.kamco.cd.training.train.dto.ModelTrainLinkDto;
import com.querydsl.core.types.Projections;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.util.List;
import lombok.RequiredArgsConstructor;
@@ -33,9 +36,44 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
@Override
public List<ModelTrainLinkDto> findDatasetTrainPath(Long modelId) {
QDatasetObjEntity datasetObjEntity = QDatasetObjEntity.datasetObjEntity;
// =====================
// 조건 분리
// =====================
BooleanExpression g1 =
modelMasterEntity
.modelNo
.eq(ModelType.G1.getId())
.and(
datasetObjEntity.targetClassCd.in(
DetectionClassification.CONTAINER.getId(),
DetectionClassification.BUILDING.getId()));
BooleanExpression g2 =
modelMasterEntity
.modelNo
.eq(ModelType.G2.getId())
.and(datasetObjEntity.targetClassCd.eq(DetectionClassification.WASTE.getId()));
BooleanExpression g4 =
modelMasterEntity
.modelNo
.eq(ModelType.G4.getId())
.and(datasetObjEntity.targetClassCd.eq(DetectionClassification.SOLAR.getId()));
// G3 = 전체 허용 (fallback)
BooleanExpression g3 =
modelMasterEntity
.modelNo
.eq(ModelType.G3.getId())
.and(
datasetObjEntity.targetClassCd.notIn(
DetectionClassification.CONTAINER.getId(),
DetectionClassification.BUILDING.getId(),
DetectionClassification.WASTE.getId(),
DetectionClassification.SOLAR.getId()));
return queryFactory
.select(
Projections.constructor(
@@ -60,17 +98,7 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
datasetObjEntity
.datasetUid
.eq(modelDatasetMappEntity.datasetUid)
.and(
modelMasterEntity
.modelNo
.eq(ModelType.G1.getId())
.and(datasetObjEntity.targetClassCd.upper().in("CONTAINER", "BUILDING"))
.or(
modelMasterEntity
.modelNo
.eq(ModelType.G2.getId())
.and(datasetObjEntity.targetClassCd.upper().eq("WASTE")))
.or(modelMasterEntity.modelNo.eq(ModelType.G3.getId()))))
.and(g1.or(g2).or(g4).or(g3)))
.where(modelMasterEntity.id.eq(modelId))
.fetch();
}
@@ -80,6 +108,42 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
QDatasetValObjEntity datasetValObjEntity = QDatasetValObjEntity.datasetValObjEntity;
// =====================
// 조건 분리
// =====================
BooleanExpression g1 =
modelMasterEntity
.modelNo
.eq(ModelType.G1.getId())
.and(
datasetValObjEntity.targetClassCd.in(
DetectionClassification.CONTAINER.getId(),
DetectionClassification.BUILDING.getId()));
BooleanExpression g2 =
modelMasterEntity
.modelNo
.eq(ModelType.G2.getId())
.and(datasetValObjEntity.targetClassCd.eq(DetectionClassification.WASTE.getId()));
BooleanExpression g4 =
modelMasterEntity
.modelNo
.eq(ModelType.G4.getId())
.and(datasetValObjEntity.targetClassCd.eq(DetectionClassification.SOLAR.getId()));
// G3 = 전체 허용 (fallback)
BooleanExpression g3 =
modelMasterEntity
.modelNo
.eq(ModelType.G3.getId())
.and(
datasetValObjEntity.targetClassCd.notIn(
DetectionClassification.CONTAINER.getId(),
DetectionClassification.BUILDING.getId(),
DetectionClassification.WASTE.getId(),
DetectionClassification.SOLAR.getId()));
return queryFactory
.select(
Projections.constructor(
@@ -104,17 +168,7 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
datasetValObjEntity
.datasetUid
.eq(modelDatasetMappEntity.datasetUid)
.and(
modelMasterEntity
.modelNo
.eq(ModelType.G1.getId())
.and(datasetValObjEntity.targetClassCd.upper().in("CONTAINER", "BUILDING"))
.or(
modelMasterEntity
.modelNo
.eq(ModelType.G2.getId())
.and(datasetValObjEntity.targetClassCd.upper().eq("WASTE")))
.or(modelMasterEntity.modelNo.eq(ModelType.G3.getId()))))
.and(g1.or(g2).or(g4).or(g3)))
.where(modelMasterEntity.id.eq(modelId))
.fetch();
}
@@ -124,6 +178,42 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
QDatasetTestObjEntity datasetTestObjEntity = QDatasetTestObjEntity.datasetTestObjEntity;
// =====================
// 조건 분리
// =====================
BooleanExpression g1 =
modelMasterEntity
.modelNo
.eq(ModelType.G1.getId())
.and(
datasetTestObjEntity.targetClassCd.in(
DetectionClassification.CONTAINER.getId(),
DetectionClassification.BUILDING.getId()));
BooleanExpression g2 =
modelMasterEntity
.modelNo
.eq(ModelType.G2.getId())
.and(datasetTestObjEntity.targetClassCd.eq(DetectionClassification.WASTE.getId()));
BooleanExpression g4 =
modelMasterEntity
.modelNo
.eq(ModelType.G4.getId())
.and(datasetTestObjEntity.targetClassCd.eq(DetectionClassification.SOLAR.getId()));
// G3 = 전체 허용 (fallback)
BooleanExpression g3 =
modelMasterEntity
.modelNo
.eq(ModelType.G3.getId())
.and(
datasetTestObjEntity.targetClassCd.notIn(
DetectionClassification.CONTAINER.getId(),
DetectionClassification.BUILDING.getId(),
DetectionClassification.WASTE.getId(),
DetectionClassification.SOLAR.getId()));
return queryFactory
.select(
Projections.constructor(
@@ -148,17 +238,7 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
datasetTestObjEntity
.datasetUid
.eq(modelDatasetMappEntity.datasetUid)
.and(
modelMasterEntity
.modelNo
.eq(ModelType.G1.getId())
.and(datasetTestObjEntity.targetClassCd.upper().in("CONTAINER", "BUILDING"))
.or(
modelMasterEntity
.modelNo
.eq(ModelType.G2.getId())
.and(datasetTestObjEntity.targetClassCd.upper().eq("WASTE")))
.or(modelMasterEntity.modelNo.eq(ModelType.G3.getId()))))
.and(g1.or(g2).or(g4).or(g3)))
.where(modelMasterEntity.id.eq(modelId))
.fetch();
}