kcg-ai-monitoring/prediction
htlee 20806ee80c fix(prediction): dark_suspicion Adapter 입력 매핑 교정 (run_outputs 0 rows silent)
기존 DarkSuspicionModel.run() 이 ctx.inputs[*].features.gap_info.is_dark
로 대상을 필터했으나, 실제 AnalysisResult.features 는 gap_info 키를
포함하지 않고 다음으로 이미 flatten 저장됨:
  - dark_suspicion_score (0~100 int)
  - dark_tier ('CRITICAL'/'HIGH'/'WATCH'/'NONE')
  - dark_patterns (list[str])
  - gap_start_state / gap_start_sog / gap_start_lat / gap_start_lon

결과: PRIMARY 승격 + feature flag=1 적용해도 Adapter 가 한 선박도
평가하지 못해 detection_model_run_outputs 에 0 rows 적재 — E2E 검증
에서 evaluated_count=0 메트릭이 silent 조기 포착.

수정: Adapter 를 transshipment/risk/pair_trawl 과 동일한 관찰형으로 재작성.
  - row.is_dark 필터 후 기존 결과(score/tier/patterns) JSONB snapshot 기록
  - critical/high/watch/none_count + avg_score 메트릭 집계
  - input_ref: {mmsi, analyzed_at, gap_min}

운영 반영 후 1 사이클에서 3508 rows 적재 (141 CRITICAL / 467 HIGH /
963 WATCH / avg_score=27.78) 확인.

범위 밖 (후속 PR):
- compute_dark_suspicion 에 ACTIVE 버전 params 를 런타임 주입해 실제
  score/tier 재계산하는 scheduler 호출부 리팩토링. 현 상태는 params
  카탈로그 관찰까지만 (나머지 4 모델과 동일 수준).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 16:05:38 +09:00
..
algorithms feat(prediction): Phase 2 PoC 2~5 — gear_violation/transshipment/risk/pair_trawl 2026-04-20 10:11:16 +09:00
cache feat: prediction 알고리즘 재설계 + 프론트 CRUD 권한 가드 보완 (#29) 2026-04-13 11:08:11 +09:00
chat feat: S2 prediction 분석 엔진 모노레포 이식 2026-04-07 12:56:51 +09:00
data feat: prediction 알고리즘 재설계 + 프론트 CRUD 권한 가드 보완 (#29) 2026-04-13 11:08:11 +09:00
db feat(prediction): Phase 1-2 detection model registry + snapshot 관찰 보강 2026-04-20 08:07:29 +09:00
models feat(prediction): vessel_analysis_results 에 분석 시점 lat/lon 저장 2026-04-16 14:30:49 +09:00
models_core fix(prediction): dark_suspicion Adapter 입력 매핑 교정 (run_outputs 0 rows silent) 2026-04-20 16:05:38 +09:00
output fix(prediction): stats_aggregator hour 경계 silent 누락 복구 2026-04-20 13:32:44 +09:00
pipeline refactor(prediction): 사이클 스테이지 에러 경계 도입 (Phase 0-1) 2026-04-17 11:28:30 +09:00
scripts feat(prediction): Phase 1-2 detection model registry + snapshot 관찰 보강 2026-04-20 08:07:29 +09:00
tests fix(prediction): stats_aggregator hour 경계 silent 누락 복구 2026-04-20 13:32:44 +09:00
config.py feat: prediction 알고리즘 재설계 + 프론트 CRUD 권한 가드 보완 (#29) 2026-04-13 11:08:11 +09:00
env.example feat: S2 prediction 분석 엔진 모노레포 이식 2026-04-07 12:56:51 +09:00
fleet_tracker.py feat(detection): GEAR_IDENTITY_COLLISION 탐지 패턴 추가 2026-04-17 06:53:12 +09:00
main.py feat(detection): DAR-03 어구 탐지 워크플로우 + 모선 검토 UI + 24h 리플레이 통합 2026-04-15 13:26:15 +09:00
requirements.txt feat: S2 prediction 분석 엔진 모노레포 이식 2026-04-07 12:56:51 +09:00
scheduler.py feat(prediction): Phase 1-2 detection model registry + snapshot 관찰 보강 2026-04-20 08:07:29 +09:00
time_bucket.py feat: S2 prediction 분석 엔진 모노레포 이식 2026-04-07 12:56:51 +09:00