MarketLens AI
AI-powered stock decision support analyzing market trends and real-world signals — FastAPI serving a Random Forest + LightGBM ensemble over a PostgreSQL data layer.
System Architecture
Ingest workers normalize market feeds and real-world signals into PostgreSQL. The feature pipeline builds training windows for the Random Forest + LightGBM ensemble. At request time, FastAPI pulls recent data, runs inference, and returns a scored decision.
Database Design
Time-series market data and external signals key off instruments; predictions link back to both the instrument and the exact model version that produced them.
Engineering Challenges
Signal fusion
Market prices and unstructured real-world signals are normalized into one comparable feature space.
Training pipeline
Windowed feature generation and scheduled retraining keep the ensemble current as market regimes shift.
Fast inference
Model loading, caching, and lean feature queries keep decision endpoints responsive.
Explainability
Tree-based models expose feature importance, so a decision can always be traced to its drivers.