How justingore4/nbastatspredictor works
AIverson Bets is a Flask app for predicting an NBA player’s points against an opponent. Users choose a player, team, and recent-game count; the app validates the request, filters historical data, prepares model features, predicts points, and renders a result. A separate data-collection and training workflow supplies the CSV and saved model. The README describes a chart of recent performance, but the sampled app code does not pass chart data to the result template, so that connection is not mapped.
Main entry points: app.py Flask app · fetch_player_data.py Game-log collector · index.html Prediction form · prediction_result.html Prediction result
Components 11
Web experience
- Flask app
app.py - Prediction form
templates/index.html - Prediction result
templates/prediction_result.html - Page styling
static/styles.css
Prediction runtime
- Player and team catalog
config.py - Game history CSV
player_last_10_games.csv - XGBoost model
xgboost_model.pkl
Data and model pipeline
- Game-log collector
fetch_player_data.py - Model training
fetch_and_train_model.py
External data
- NBA API
Other components
- User
Connections 15
- User → Flask app: submits request
- Flask app → Prediction form: renders form
- Flask app → Player and team catalog: reads catalog
- Flask app → XGBoost model: loads and predicts
- Flask app → Game history CSV: reads games
- Flask app → Prediction result: renders prediction
- Prediction form → User: presents choices
- Prediction result → User: displays result
- Page styling → Prediction form: styles page
- Page styling → Prediction result: styles page
- Game-log collector → NBA API: requests game logs
- Game-log collector → Player and team catalog: reads player catalog
- Game-log collector → Game history CSV: writes game history
- Model training → Game history CSV: reads training data
- Model training → XGBoost model: saves trained model