Spaces:
Running
Running
BraydenMoore
commited on
Commit
•
7257aaa
1
Parent(s):
fd27196
Update lines. Allow bye weeks
Browse files
Source/Data/gbg_and_odds_this_year-Thinkpad.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ffb812ba82afc8e124ea3186f8bcc04e66a10b15e9507e6fa8e6eba18463c5f7
|
3 |
+
size 276
|
Source/Data/lines.json
CHANGED
@@ -68,5 +68,22 @@
|
|
68 |
53,
|
69 |
45.5,
|
70 |
45
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
]
|
72 |
}
|
|
|
68 |
53,
|
69 |
45.5,
|
70 |
45
|
71 |
+
],
|
72 |
+
"6":[
|
73 |
+
46.5,
|
74 |
+
41.5,
|
75 |
+
42.5,
|
76 |
+
43.5,
|
77 |
+
44.5,
|
78 |
+
37,
|
79 |
+
42,
|
80 |
+
48,
|
81 |
+
41,
|
82 |
+
42.5,
|
83 |
+
49,
|
84 |
+
40.5,
|
85 |
+
44.5,
|
86 |
+
44.5,
|
87 |
+
51
|
88 |
]
|
89 |
}
|
Source/Data/predictions.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0c67a5b32fca86661a44a993df5b8001073ab8e99fc0a588d050bfc04bb4f0c3
|
3 |
+
size 20000
|
Source/Predict/__pycache__/predict.cpython-311.pyc
CHANGED
Binary files a/Source/Predict/__pycache__/predict.cpython-311.pyc and b/Source/Predict/__pycache__/predict.cpython-311.pyc differ
|
|
Source/Predict/predict.py
CHANGED
@@ -80,19 +80,23 @@ def get_games(week):
|
|
80 |
|
81 |
def get_one_week(home,away,season,week):
|
82 |
try:
|
83 |
-
|
|
|
|
|
|
|
84 |
gbg_home_team = home_df['home_team'].item()
|
85 |
home_df.drop(columns=['game_id','home_team','away_team','Season','game_date'], inplace=True)
|
86 |
home_df = home_df[[i for i in home_df.columns if '.Away' not in i] if gbg_home_team==home else [i for i in home_df.columns if '.Away' in i]]
|
87 |
home_df.columns = [i.replace('.Away','') for i in home_df.columns]
|
88 |
|
89 |
-
away_df = gbg.loc[((gbg['away_team']==away) | (gbg['home_team']==away)) & (gbg['Season']==season) & (gbg['GP']==
|
90 |
gbg_home_team = away_df['home_team'].item()
|
91 |
away_df.drop(columns=['game_id','home_team','away_team','Season','game_date'], inplace=True)
|
92 |
away_df = away_df[[i for i in away_df.columns if '.Away' not in i] if gbg_home_team==away else [i for i in away_df.columns if '.Away' in i]]
|
93 |
away_df.columns = [i.replace('.Away','') + '.Away' for i in away_df.columns]
|
94 |
|
95 |
-
df = home_df.merge(away_df,
|
|
|
96 |
return df
|
97 |
except ValueError:
|
98 |
return pd.DataFrame()
|
|
|
80 |
|
81 |
def get_one_week(home,away,season,week):
|
82 |
try:
|
83 |
+
max_GP_home = gbg.loc[((gbg['home_team'] == home) | (gbg['away_team'] == home)) & (gbg['GP'] < week)]['GP'].max()
|
84 |
+
max_GP_away = gbg.loc[((gbg['home_team'] == away) | (gbg['away_team'] == away)) & (gbg['GP'] < week)]['GP'].max()
|
85 |
+
|
86 |
+
home_df = gbg.loc[((gbg['away_team']==home) | (gbg['home_team']==home)) & (gbg['Season']==season) & (gbg['GP']==max_GP_home)]
|
87 |
gbg_home_team = home_df['home_team'].item()
|
88 |
home_df.drop(columns=['game_id','home_team','away_team','Season','game_date'], inplace=True)
|
89 |
home_df = home_df[[i for i in home_df.columns if '.Away' not in i] if gbg_home_team==home else [i for i in home_df.columns if '.Away' in i]]
|
90 |
home_df.columns = [i.replace('.Away','') for i in home_df.columns]
|
91 |
|
92 |
+
away_df = gbg.loc[((gbg['away_team']==away) | (gbg['home_team']==away)) & (gbg['Season']==season) & (gbg['GP']==max_GP_away)]
|
93 |
gbg_home_team = away_df['home_team'].item()
|
94 |
away_df.drop(columns=['game_id','home_team','away_team','Season','game_date'], inplace=True)
|
95 |
away_df = away_df[[i for i in away_df.columns if '.Away' not in i] if gbg_home_team==away else [i for i in away_df.columns if '.Away' in i]]
|
96 |
away_df.columns = [i.replace('.Away','') + '.Away' for i in away_df.columns]
|
97 |
|
98 |
+
df = home_df.reset_index(drop=True).merge(away_df.reset_index(drop=True), left_index=True, right_index=True)
|
99 |
+
print(df)
|
100 |
return df
|
101 |
except ValueError:
|
102 |
return pd.DataFrame()
|