
Annual Auto-Retraining for NPB Baseball Predictions with GitHub Actions
Background I built a Japanese professional baseball (NPB) player performance prediction system. → Previous article: Why Marcel Beat LightGBM: Building an NPB Player Performance Prediction System After getting it working, I realized I was running python ml_projection.py manually every November. That meant all of this was manual: Web scraping (data fetch) Model retraining Prediction CSV update Checking whether accuracy improved year-over-year So I automated it with GitHub Actions, and added model artifact saving and accuracy logging. → GitHub : https://github.com/yasumorishima/npb-prediction 3 Things I Added Feature What I did Model saving joblib → .pkl files in data/models/ , one per year Metrics logging Marcel vs ML MAE saved to JSON + FastAPI /metrics endpoint Auto-run GitHub Actions cron, every November 1st ① Save Models with joblib After training, save each model to a .pkl file: import joblib from pathlib import Path MODELS_DIR = Path ( " data/models " ) MODELS_DIR . mkdir ( parents
Continue reading on Dev.to Python
Opens in a new tab


