arvindrangarajan commited on
Commit
bb6dde1
·
verified ·
1 Parent(s): dceeb62

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +95 -0
  2. model_metadata.json +145 -0
  3. scaler.joblib +3 -0
  4. xgboost_model.json +0 -0
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: NBA Performance Predictor
3
+ emoji: 🏀
4
+ colorFrom: orange
5
+ colorTo: red
6
+ sdk: gradio
7
+ sdk_version: 3.40.0
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ ---
12
+
13
+
14
+ # NBA Player Performance Predictor
15
+
16
+ ## Model Description
17
+
18
+ This model predicts NBA player points per game (PPG) using XGBoost regression with time-series features. The model uses historical player statistics, lag features, and engineered metrics to make predictions.
19
+
20
+ ## Model Details
21
+
22
+ - **Model Type**: XGBoost Regressor
23
+ - **Task**: Regression (Predicting NBA player points per game)
24
+ - **Framework**: scikit-learn, XGBoost
25
+ - **Performance**: RMSE ~3-5 points per game, R² ~0.6-0.8
26
+
27
+ ## Features
28
+
29
+ The model uses various features including:
30
+ - Basic stats: Age, Games, Minutes Played, Field Goals, etc.
31
+ - Lag features: Previous season performance metrics
32
+ - Rolling averages: 2-3 year performance averages
33
+ - Efficiency metrics: Points per minute, overall efficiency
34
+ - Categorical encodings: Position, Team, Age category
35
+
36
+ ## Usage
37
+
38
+ ```python
39
+ from huggingface_model import NBAPerformancePredictorHF
40
+
41
+ # Load the model
42
+ model = NBAPerformancePredictorHF("path/to/model")
43
+
44
+ # Example prediction
45
+ player_stats = {
46
+ 'Age': 27,
47
+ 'G': 75,
48
+ 'GS': 70,
49
+ 'MP': 35.0,
50
+ 'FG': 8.5,
51
+ 'FGA': 18.0,
52
+ 'FG_1': 0.472,
53
+ 'Pos_encoded': 2,
54
+ 'Team_encoded': 15,
55
+ 'Age_category_encoded': 1,
56
+ 'PTS_lag_1': 22.5,
57
+ 'PTS_lag_2': 21.0,
58
+ 'TRB_lag_1': 7.2,
59
+ 'AST_lag_1': 4.8
60
+ }
61
+
62
+ predicted_points = model.predict(player_stats)
63
+ print(f"Predicted PPG: {predicted_points:.2f}")
64
+ ```
65
+
66
+ ## Training Data
67
+
68
+ The model was trained on NBA player statistics from multiple seasons, including:
69
+ - Regular season statistics
70
+ - Playoff performance data
71
+ - Historical player performance trends
72
+
73
+ ## Limitations
74
+
75
+ - Requires historical data (lag features) for accurate predictions
76
+ - Performance may vary for rookie players or players with limited history
77
+ - Model is trained on specific NBA eras and may need retraining for different time periods
78
+
79
+ ## Ethical Considerations
80
+
81
+ This model is for educational and analytical purposes. It should not be used for:
82
+ - Player salary negotiations
83
+ - Draft decisions without additional context
84
+ - Any form of discrimination or bias
85
+
86
+ ## Citation
87
+
88
+ ```
89
+ @misc{nba_performance_predictor,
90
+ title={NBA Player Performance Predictor using XGBoost},
91
+ year={2024},
92
+ publisher={Hugging Face},
93
+ howpublished={\url{https://huggingface.co/your-username/nba-performance-predictor}}
94
+ }
95
+ ```
model_metadata.json ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "feature_names": [
3
+ "Age",
4
+ "G",
5
+ "GS",
6
+ "MP",
7
+ "FG",
8
+ "FGA",
9
+ "FG_1",
10
+ "3P",
11
+ "3PA",
12
+ "3P_1",
13
+ "2P",
14
+ "2PA",
15
+ "2P_1",
16
+ "eFG",
17
+ "FT",
18
+ "FTA",
19
+ "FT_1",
20
+ "ORB",
21
+ "DRB",
22
+ "TRB",
23
+ "AST",
24
+ "STL",
25
+ "BLK",
26
+ "TOV",
27
+ "PF",
28
+ "Pos_encoded",
29
+ "Team_encoded",
30
+ "Age_category_encoded",
31
+ "Points_per_minute",
32
+ "Efficiency",
33
+ "Usage_rate",
34
+ "PTS_lag_1",
35
+ "PTS_lag_2",
36
+ "PTS_lag_3",
37
+ "TRB_lag_1",
38
+ "TRB_lag_2",
39
+ "TRB_lag_3",
40
+ "AST_lag_1",
41
+ "AST_lag_2",
42
+ "AST_lag_3",
43
+ "FG_1_lag_1",
44
+ "FG_1_lag_2",
45
+ "FG_1_lag_3",
46
+ "FT_1_lag_1",
47
+ "FT_1_lag_2",
48
+ "FT_1_lag_3",
49
+ "MP_lag_1",
50
+ "MP_lag_2",
51
+ "MP_lag_3",
52
+ "STL_lag_1",
53
+ "STL_lag_2",
54
+ "STL_lag_3",
55
+ "BLK_lag_1",
56
+ "BLK_lag_2",
57
+ "BLK_lag_3",
58
+ "Points_per_minute_lag_1",
59
+ "Points_per_minute_lag_2",
60
+ "Points_per_minute_lag_3",
61
+ "Efficiency_lag_1",
62
+ "Efficiency_lag_2",
63
+ "Efficiency_lag_3",
64
+ "Usage_rate_lag_1",
65
+ "Usage_rate_lag_2",
66
+ "Usage_rate_lag_3",
67
+ "PTS_rolling_2",
68
+ "PTS_rolling_3",
69
+ "TRB_rolling_2",
70
+ "TRB_rolling_3",
71
+ "AST_rolling_2",
72
+ "AST_rolling_3",
73
+ "FG_1_rolling_2",
74
+ "FG_1_rolling_3",
75
+ "FT_1_rolling_2",
76
+ "FT_1_rolling_3",
77
+ "MP_rolling_2",
78
+ "MP_rolling_3",
79
+ "STL_rolling_2",
80
+ "STL_rolling_3",
81
+ "BLK_rolling_2",
82
+ "BLK_rolling_3",
83
+ "Points_per_minute_rolling_2",
84
+ "Points_per_minute_rolling_3",
85
+ "Efficiency_rolling_2",
86
+ "Efficiency_rolling_3",
87
+ "Usage_rate_rolling_2",
88
+ "Usage_rate_rolling_3",
89
+ "PTS_trend",
90
+ "TRB_trend",
91
+ "AST_trend",
92
+ "FG_1_trend",
93
+ "FT_1_trend",
94
+ "MP_trend",
95
+ "STL_trend",
96
+ "BLK_trend",
97
+ "Points_per_minute_trend",
98
+ "Efficiency_trend",
99
+ "Usage_rate_trend"
100
+ ],
101
+ "target_column": "PTS",
102
+ "model_type": "XGBRegressor",
103
+ "model_params": {
104
+ "objective": "reg:squarederror",
105
+ "base_score": null,
106
+ "booster": null,
107
+ "callbacks": null,
108
+ "colsample_bylevel": null,
109
+ "colsample_bynode": null,
110
+ "colsample_bytree": 1.0,
111
+ "device": null,
112
+ "early_stopping_rounds": null,
113
+ "enable_categorical": false,
114
+ "eval_metric": null,
115
+ "feature_types": null,
116
+ "feature_weights": null,
117
+ "gamma": null,
118
+ "grow_policy": null,
119
+ "importance_type": null,
120
+ "interaction_constraints": null,
121
+ "learning_rate": 0.1,
122
+ "max_bin": null,
123
+ "max_cat_threshold": null,
124
+ "max_cat_to_onehot": null,
125
+ "max_delta_step": null,
126
+ "max_depth": 3,
127
+ "max_leaves": null,
128
+ "min_child_weight": null,
129
+ "missing": NaN,
130
+ "monotone_constraints": null,
131
+ "multi_strategy": null,
132
+ "n_estimators": 300,
133
+ "n_jobs": -1,
134
+ "num_parallel_tree": null,
135
+ "random_state": 42,
136
+ "reg_alpha": null,
137
+ "reg_lambda": null,
138
+ "sampling_method": null,
139
+ "scale_pos_weight": null,
140
+ "subsample": 1.0,
141
+ "tree_method": null,
142
+ "validate_parameters": null,
143
+ "verbosity": null
144
+ }
145
+ }
scaler.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0efa805a260525a8dc2a305bf5850a8ecea073e5d7122965f1982df31706432a
3
+ size 129
xgboost_model.json ADDED
The diff for this file is too large to render. See raw diff