NFL Fantasy ML Predictions is a full-stack web page for generating, blending, and serving machine learning-based fantasy football player projections. The system leverages modern MLOps, robust backend APIs, and a responsive frontend to deliver actionable insights for fantasy football enthusiasts and analysts. This project was designed for the purpose of creating a personal project leveraging technologies that I have not actively used to make me more familiar with them.
The core of this project involves training advanced machine learning models to generate player fantasy point projections. The training pipeline is designed to be robust and flexible, leveraging state-of-the-art ensemble methods:
- The primary model is a LightGBM (LGBMRegressor) gradient boosting machine, which is used when available for its efficiency and predictive power on structured data.
- If LightGBM is not available, the pipeline falls back to an ensemble of HistGradientBoostingRegressor and RandomForestRegressor, averaging their predictions to improve generalization and reduce variance.
- As a final fallback, HistGradientBoostingRegressor is used on its own.
The workflow includes:
- Data ingestion and feature engineering from multiple sources, including player statistics, team context, and schedule-based features
- Preprocessing with column transformers to scale numeric features and one-hot encode categorical variables
- Train/validation split by season to ensure robust out-of-sample evaluation
- Model training using the most advanced available ensemble method, optimizing for predictive accuracy on fantasy points (PPR)
- Evaluation using metrics such as RMSE and MAE to assess model performance
- Serialization of trained models as joblib artifacts for reproducibility and downstream use
- Batch prediction to generate season-long player projections, which are saved as CSV files for further blending and API serving
This approach enables the system to leverage both historical data and contextual features, producing high-quality, data-driven projections that power the rest of the application.
- Framework: FastAPI for high-performance, async REST APIs.
- Core Features:
- Player Projections API: Serves real-time, per-player, per-week fantasy projections with confidence intervals.
- Draft Simulation: Generates optimal draft teams using blended ML and expert projections, simulating human-like draft strategies.
- Data Handling: Dynamically loads and processes model outputs and expert rankings, normalizing and blending them for downstream use.
- ML Integration: Reads from precomputed model outputs and expert rankings, blending them using advanced normalization and weighted scoring.
- Containerized: Dockerfile and
docker-compose.ymlfor reproducible, scalable deployment.
- Modeling: Utilizes scikit-learn, pandas, and joblib for model training, evaluation, and serialization.
- Blending Logic: Custom scripts blend ML projections with expert ranks and qualitative features (e.g., "stars"), using MinMax scaling and weighted aggregation.
- NFL Python Library: Data is programmatically ingested from a specialized NFL Python library, enabling access to up-to-date player stats, schedules, and injury reports directly from official league sources.
- Rich CSV Datasets: The pipeline integrates a variety of CSV files containing:
- Player-level season and weekly stats
- Team aggregates and advanced metrics
- Schedule and matchup impact
- Injury history and status
- Feature Engineering: These diverse data sources are joined and transformed to create a comprehensive feature set, capturing both quantitative and contextual factors that drive fantasy performance.
- Modern Stack: Built with React 19, TypeScript, and Vite for lightning-fast development and production builds.
- UI/UX: Responsive, visually appealing interface with modals for draft results, interactive team building, and real-time feedback.
- Componentization: Modular React components for maintainability and scalability.
- Styling: Tailwind CSS for rapid, consistent, and modern UI design.
- Version Control: Strict
.gitignoreand DVC configuration to ensure only code and essential configs are versioned. - CI/CD Ready: Containerized for seamless deployment to cloud platforms like Railway.
- Postgres & Redis: Integrated via Docker Compose for persistent storage and caching.
- End-to-End ML Pipeline: From raw data ingestion and feature engineering to model training, blending, and serving.
- API-Driven: All core functionality is exposed via robust, documented REST endpoints.
- Draft Team Recommendation: Simulates snake drafts, accounting for league size, pick order, and positional needs.
- Blended Projections: Combines quantitative model outputs with expert qualitative input for superior accuracy.
- Cloud-Ready: Easily deployable to Railway or any container-based cloud platform.
Below are screenshots demonstrating the core user experience and UI polish of the NFL Fantasy ML Predictions platform:
MIT License


