feat(phase-3): Chronos zero-shot 예측 + 피처 빌더

- backend/app/models/chronos.py: amazon/chronos-t5-small (env CHRONOS_MODEL
  override 가능). lazy singleton, cuda + bf16 자동, q10/median/q90 + raw
  samples 반환 (앙상블 가중평균용).
- backend/app/models/features.py: 종목별 학습/추론 피처 DataFrame.
  OHLCV + TA(rsi/macd/atr/bb/sma/ema/vol_z) + 외인기관거래대금 + macro
  (kospi/kosdaq/usdkrw/us10y + r1) + sentiment(v_sentiment_daily, 3d rolling).
  학습용은 with_targets=True 로 y_close_h{1,3,5}, y_ret_h*, y_dir_h*
  (±0.3% flat band) 추가.
- pyproject.toml: chronos-forecasting 1.4.1, accelerate 0.30.1, joblib 1.4.2.

이 단계까지는 코드만. 실제 모델 다운로드는 첫 ping/predict 호출 시점에.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
tkrmagid
2026-05-20 15:59:14 +09:00
parent edda01adbf
commit b1ca6ab5d3
3 changed files with 344 additions and 0 deletions

View File

@@ -31,9 +31,12 @@ dependencies = [
"transformers==4.41.2",
"tokenizers==0.19.1",
"sentencepiece==0.2.0",
"accelerate==0.30.1",
"chronos-forecasting==1.4.1",
"scikit-learn==1.5.0",
"lightgbm==4.3.0",
"ta==0.11.0",
"joblib==1.4.2",
# scheduler
"apscheduler==3.10.4",