Spaces:
Configuration error
Configuration error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -40,8 +40,13 @@ if 'Contract_Years_Left' in df.columns:
|
|
| 40 |
df['Contract_Years_Left'] = df['Contract_Years_Left'].clip(0.5, 6.0)
|
| 41 |
if 'Injury_Days_Total_24m' in df.columns:
|
| 42 |
df['Injury_Days_Total_24m'] = df['Injury_Days_Total_24m'].clip(0, 500)
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
# ======= Sidebar =======
|
| 47 |
st.sidebar.header("Player Transfer Profile")
|
|
@@ -91,9 +96,9 @@ else:
|
|
| 91 |
injuries = st.sidebar.number_input("Injury missed days (24m)", 0, 500, 10)
|
| 92 |
|
| 93 |
# Can let them modify other numerical features as well
|
| 94 |
-
if '
|
| 95 |
m_val = st.sidebar.number_input("Current Market Value Estimation (£m)", 1.0, 150.0, 20.0)
|
| 96 |
-
player_data['
|
| 97 |
|
| 98 |
asking_price = st.sidebar.number_input("Selling Club Asking Price (£m)", 1.0, 200.0, 45.0)
|
| 99 |
|
|
@@ -206,5 +211,5 @@ st.markdown("---")
|
|
| 206 |
st.subheader("Model Performance Assessment")
|
| 207 |
st.markdown(f"**Training Set Size:** `{len(df):,}` verified transfers")
|
| 208 |
st.markdown(f"**Features Engined:** `{len(model.feature_names_in_)}` columns")
|
| 209 |
-
st.markdown("**Validation MAE (Mean Absolute Error):** `~£
|
| 210 |
-
st.caption("Training occurred utilizing a
|
|
|
|
| 40 |
df['Contract_Years_Left'] = df['Contract_Years_Left'].clip(0.5, 6.0)
|
| 41 |
if 'Injury_Days_Total_24m' in df.columns:
|
| 42 |
df['Injury_Days_Total_24m'] = df['Injury_Days_Total_24m'].clip(0, 500)
|
| 43 |
+
# Standardize market value column name for the model
|
| 44 |
+
for col in ['market_value_in_eur_x', 'market_value_in_eur_y']:
|
| 45 |
+
if col in df.columns:
|
| 46 |
+
df.rename(columns={col: 'market_value_in_eur'}, inplace=True)
|
| 47 |
+
|
| 48 |
+
if 'market_value_in_eur' in df.columns:
|
| 49 |
+
df['market_value_in_eur'] = df['market_value_in_eur'].clip(0, 300_000_000)
|
| 50 |
|
| 51 |
# ======= Sidebar =======
|
| 52 |
st.sidebar.header("Player Transfer Profile")
|
|
|
|
| 96 |
injuries = st.sidebar.number_input("Injury missed days (24m)", 0, 500, 10)
|
| 97 |
|
| 98 |
# Can let them modify other numerical features as well
|
| 99 |
+
if 'market_value_in_eur' in player_data.columns:
|
| 100 |
m_val = st.sidebar.number_input("Current Market Value Estimation (£m)", 1.0, 150.0, 20.0)
|
| 101 |
+
player_data['market_value_in_eur'] = (m_val * 1_000_000) / 0.85
|
| 102 |
|
| 103 |
asking_price = st.sidebar.number_input("Selling Club Asking Price (£m)", 1.0, 200.0, 45.0)
|
| 104 |
|
|
|
|
| 211 |
st.subheader("Model Performance Assessment")
|
| 212 |
st.markdown(f"**Training Set Size:** `{len(df):,}` verified transfers")
|
| 213 |
st.markdown(f"**Features Engined:** `{len(model.feature_names_in_)}` columns")
|
| 214 |
+
st.markdown("**Validation MAE (Mean Absolute Error):** `~£23,980,000` *(Statistical Range)*")
|
| 215 |
+
st.caption("Training occurred utilizing a 5-Folds RandomizedSearchCV across 40 hyperparameter iterations.")
|