Hierarchical ML Pipeline for trading predictions:
- Level 0: Attention Models (volatility/flow classification)
- Level 1: Base Models (XGBoost per symbol/timeframe)
- Level 2: Metamodels (XGBoost Stacking + Neural Gating)
Key components:
- src/pipelines/hierarchical_pipeline.py - Main prediction pipeline
- src/models/ - All ML model classes
- src/training/ - Training utilities
- src/api/ - FastAPI endpoints
- scripts/ - Training and evaluation scripts
- config/ - YAML configurations
Note: Trained models (*.joblib, *.pt) are gitignored.
Regenerate with training scripts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
780 B
Docker
37 lines
780 B
Docker
# ML Engine Dockerfile
|
|
# OrbiQuant IA - Trading Platform
|
|
|
|
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Instalar dependencias del sistema
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
curl \
|
|
libpq-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copiar requirements primero para cache de layers
|
|
COPY requirements.txt .
|
|
|
|
# Instalar dependencias Python
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copiar código fuente
|
|
COPY . .
|
|
|
|
# Variables de entorno
|
|
ENV PYTHONPATH=/app
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# Puerto
|
|
EXPOSE 8000
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD curl -f http://localhost:8000/health || exit 1
|
|
|
|
# Comando de inicio
|
|
CMD ["uvicorn", "src.api.main:app", "--host", "0.0.0.0", "--port", "8000"]
|