임시 데이터셋 폴더 생성 G4 추가
This commit is contained in:
@@ -14,7 +14,7 @@ import lombok.Setter;
|
|||||||
public class HyperParam {
|
public class HyperParam {
|
||||||
|
|
||||||
@Schema(description = "모델", example = "G1")
|
@Schema(description = "모델", example = "G1")
|
||||||
private ModelType model; // G1, G2, G3
|
private ModelType model; // G1, G2, G3, G4
|
||||||
|
|
||||||
// -------------------------
|
// -------------------------
|
||||||
// Important
|
// Important
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class HyperParamApiController {
|
|||||||
LocalDate endDate,
|
LocalDate endDate,
|
||||||
@Parameter(description = "버전명", example = "G1_000019") @RequestParam(required = false)
|
@Parameter(description = "버전명", example = "G1_000019") @RequestParam(required = false)
|
||||||
String hyperVer,
|
String hyperVer,
|
||||||
@Parameter(description = "모델 타입 (G1, G2, G3 중 하나)", example = "G1")
|
@Parameter(description = "모델 타입 (G1, G2, G3, G4 중 하나)", example = "G1")
|
||||||
@RequestParam(required = false)
|
@RequestParam(required = false)
|
||||||
ModelType model,
|
ModelType model,
|
||||||
@Parameter(
|
@Parameter(
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class ModelTrainMngApiController {
|
|||||||
@Parameter(
|
@Parameter(
|
||||||
description = "모델",
|
description = "모델",
|
||||||
example = "G1",
|
example = "G1",
|
||||||
schema = @Schema(allowableValues = {"G1", "G2", "G3"}))
|
schema = @Schema(allowableValues = {"G1", "G2", "G3", "G4"}))
|
||||||
@RequestParam(required = false)
|
@RequestParam(required = false)
|
||||||
String modelNo,
|
String modelNo,
|
||||||
@Parameter(description = "페이지 번호") @RequestParam(defaultValue = "0") int page,
|
@Parameter(description = "페이지 번호") @RequestParam(defaultValue = "0") int page,
|
||||||
|
|||||||
@@ -522,9 +522,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
|||||||
dataset.targetYyyy,
|
dataset.targetYyyy,
|
||||||
dataset.memo,
|
dataset.memo,
|
||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(
|
.when(datasetObjEntity.targetClassCd.eq(DetectionClassification.SOLAR.getId()))
|
||||||
datasetObjEntity.targetClassCd.equalsIgnoreCase(
|
|
||||||
DetectionClassification.SOLAR.getId()))
|
|
||||||
.then(1)
|
.then(1)
|
||||||
.otherwise(0)
|
.otherwise(0)
|
||||||
.sum()))
|
.sum()))
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.kamco.cd.training.postgres.repository.model;
|
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.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.QModelDatasetMappEntity.modelDatasetMappEntity;
|
||||||
import static com.kamco.cd.training.postgres.entity.QModelMasterEntity.modelMasterEntity;
|
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.common.enums.ModelType;
|
||||||
import com.kamco.cd.training.postgres.entity.ModelDatasetMappEntity;
|
import com.kamco.cd.training.postgres.entity.ModelDatasetMappEntity;
|
||||||
import com.kamco.cd.training.postgres.entity.QDatasetObjEntity;
|
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.postgres.entity.QDatasetValObjEntity;
|
||||||
import com.kamco.cd.training.train.dto.ModelTrainLinkDto;
|
import com.kamco.cd.training.train.dto.ModelTrainLinkDto;
|
||||||
import com.querydsl.core.types.Projections;
|
import com.querydsl.core.types.Projections;
|
||||||
|
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -33,9 +36,44 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ModelTrainLinkDto> findDatasetTrainPath(Long modelId) {
|
public List<ModelTrainLinkDto> findDatasetTrainPath(Long modelId) {
|
||||||
|
|
||||||
QDatasetObjEntity datasetObjEntity = QDatasetObjEntity.datasetObjEntity;
|
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
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
@@ -60,17 +98,7 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
|
|||||||
datasetObjEntity
|
datasetObjEntity
|
||||||
.datasetUid
|
.datasetUid
|
||||||
.eq(modelDatasetMappEntity.datasetUid)
|
.eq(modelDatasetMappEntity.datasetUid)
|
||||||
.and(
|
.and(g1.or(g2).or(g4).or(g3)))
|
||||||
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()))))
|
|
||||||
.where(modelMasterEntity.id.eq(modelId))
|
.where(modelMasterEntity.id.eq(modelId))
|
||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
@@ -80,6 +108,42 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
|
|||||||
|
|
||||||
QDatasetValObjEntity datasetValObjEntity = QDatasetValObjEntity.datasetValObjEntity;
|
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
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
@@ -104,17 +168,7 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
|
|||||||
datasetValObjEntity
|
datasetValObjEntity
|
||||||
.datasetUid
|
.datasetUid
|
||||||
.eq(modelDatasetMappEntity.datasetUid)
|
.eq(modelDatasetMappEntity.datasetUid)
|
||||||
.and(
|
.and(g1.or(g2).or(g4).or(g3)))
|
||||||
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()))))
|
|
||||||
.where(modelMasterEntity.id.eq(modelId))
|
.where(modelMasterEntity.id.eq(modelId))
|
||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
@@ -124,6 +178,42 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
|
|||||||
|
|
||||||
QDatasetTestObjEntity datasetTestObjEntity = QDatasetTestObjEntity.datasetTestObjEntity;
|
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
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
@@ -148,17 +238,7 @@ public class ModelDatasetMappRepositoryImpl implements ModelDatasetMappRepositor
|
|||||||
datasetTestObjEntity
|
datasetTestObjEntity
|
||||||
.datasetUid
|
.datasetUid
|
||||||
.eq(modelDatasetMappEntity.datasetUid)
|
.eq(modelDatasetMappEntity.datasetUid)
|
||||||
.and(
|
.and(g1.or(g2).or(g4).or(g3)))
|
||||||
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()))))
|
|
||||||
.where(modelMasterEntity.id.eq(modelId))
|
.where(modelMasterEntity.id.eq(modelId))
|
||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user