Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,10 +20,10 @@ def predict(team, inning, venue, hits, errors, lob, runs, opp_team, opp_runs, op
|
|
| 20 |
# print(df.columns)
|
| 21 |
# print(len(df.columns))
|
| 22 |
xgb_model = xgb.XGBRegressor()
|
| 23 |
-
xgb_model.load_model('
|
| 24 |
|
| 25 |
-
with open('pca_model3.pkl', 'rb') as f:
|
| 26 |
-
|
| 27 |
|
| 28 |
# with open('label_encoder_teams_xgbr1_exp3.pkl', 'rb') as f:
|
| 29 |
# label_encoder = pickle.load(f)
|
|
@@ -33,7 +33,7 @@ def predict(team, inning, venue, hits, errors, lob, runs, opp_team, opp_runs, op
|
|
| 33 |
|
| 34 |
df = df.astype(int)
|
| 35 |
|
| 36 |
-
df = pca.transform(df)
|
| 37 |
|
| 38 |
score = xgb_model.predict(df)
|
| 39 |
if score[0] < 0:
|
|
@@ -59,7 +59,7 @@ def predict_2(team, inning, venue, hits, errors, lob, runs, opp_team, opp_runs,
|
|
| 59 |
df = df.reindex(columns=df_main.columns, fill_value=0)
|
| 60 |
|
| 61 |
cat_model = CatBoostRegressor()
|
| 62 |
-
cat_model.load_model('
|
| 63 |
|
| 64 |
# with open('label_encoder_teams_catbr1_exp1.pkl', 'rb') as f:
|
| 65 |
# label_encoder = pickle.load(f)
|
|
@@ -72,10 +72,10 @@ def predict_2(team, inning, venue, hits, errors, lob, runs, opp_team, opp_runs,
|
|
| 72 |
|
| 73 |
df = df.astype(int)
|
| 74 |
|
| 75 |
-
with open('pca_model3.pkl', 'rb') as f:
|
| 76 |
-
|
| 77 |
|
| 78 |
-
df = pca.transform(df)
|
| 79 |
|
| 80 |
score = cat_model.predict(df)
|
| 81 |
if score[0] < 0:
|
|
|
|
| 20 |
# print(df.columns)
|
| 21 |
# print(len(df.columns))
|
| 22 |
xgb_model = xgb.XGBRegressor()
|
| 23 |
+
xgb_model.load_model('xgbr1_exp6_model.json')
|
| 24 |
|
| 25 |
+
# with open('pca_model3.pkl', 'rb') as f:
|
| 26 |
+
# pca = pickle.load(f)
|
| 27 |
|
| 28 |
# with open('label_encoder_teams_xgbr1_exp3.pkl', 'rb') as f:
|
| 29 |
# label_encoder = pickle.load(f)
|
|
|
|
| 33 |
|
| 34 |
df = df.astype(int)
|
| 35 |
|
| 36 |
+
# df = pca.transform(df)
|
| 37 |
|
| 38 |
score = xgb_model.predict(df)
|
| 39 |
if score[0] < 0:
|
|
|
|
| 59 |
df = df.reindex(columns=df_main.columns, fill_value=0)
|
| 60 |
|
| 61 |
cat_model = CatBoostRegressor()
|
| 62 |
+
cat_model.load_model('catbr1_exp7_model.json')
|
| 63 |
|
| 64 |
# with open('label_encoder_teams_catbr1_exp1.pkl', 'rb') as f:
|
| 65 |
# label_encoder = pickle.load(f)
|
|
|
|
| 72 |
|
| 73 |
df = df.astype(int)
|
| 74 |
|
| 75 |
+
# with open('pca_model3.pkl', 'rb') as f:
|
| 76 |
+
# pca = pickle.load(f)
|
| 77 |
|
| 78 |
+
# df = pca.transform(df)
|
| 79 |
|
| 80 |
score = cat_model.predict(df)
|
| 81 |
if score[0] < 0:
|