Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,11 +5,10 @@ import numpy as np
|
|
| 5 |
|
| 6 |
# Load the model and unique brand values
|
| 7 |
model = joblib.load('model.joblib')
|
| 8 |
-
|
| 9 |
-
college_values = unique_values['college']
|
| 10 |
|
| 11 |
# Define the prediction function
|
| 12 |
-
def predict(
|
| 13 |
# Convert inputs to appropriate types
|
| 14 |
year_drafted = int(year_drafted)
|
| 15 |
qb_num_picked = int(qb_num_picked)
|
|
@@ -36,8 +35,6 @@ def predict(college,conf,year_drafted,qb_num_picked,rd_picked,num_picked,coach_t
|
|
| 36 |
|
| 37 |
# Prepare the input array for prediction
|
| 38 |
input_data = pd.DataFrame({
|
| 39 |
-
'college': college,
|
| 40 |
-
'conf': conf,
|
| 41 |
'year_drafted': year_drafted,
|
| 42 |
'qb_num_picked': qb_num_picked,
|
| 43 |
'rd_picked': rd_picked,
|
|
@@ -72,7 +69,6 @@ def predict(college,conf,year_drafted,qb_num_picked,rd_picked,num_picked,coach_t
|
|
| 72 |
interface = gr.Interface(
|
| 73 |
fn=predict,
|
| 74 |
inputs=[
|
| 75 |
-
gr.Dropdown(choices=college_values, label="College"),
|
| 76 |
gr.Textbox(label="Year Drafted"),
|
| 77 |
gr.Textbox(label="QB Number Picked"),
|
| 78 |
gr.Textbox(label="Round Picked"),
|
|
|
|
| 5 |
|
| 6 |
# Load the model and unique brand values
|
| 7 |
model = joblib.load('model.joblib')
|
| 8 |
+
|
|
|
|
| 9 |
|
| 10 |
# Define the prediction function
|
| 11 |
+
def predict(year_drafted,qb_num_picked,rd_picked,num_picked,coach_tenure,height,weight,drafted_team_winpr,drafted_team_ppg_rk,conf_str,p_cmp,p_att,cmp_pct,p_yds,p_ypa,p_adj_ypa,ints,rate,r_att,r_yds,r_avg,r_tds):
|
| 12 |
# Convert inputs to appropriate types
|
| 13 |
year_drafted = int(year_drafted)
|
| 14 |
qb_num_picked = int(qb_num_picked)
|
|
|
|
| 35 |
|
| 36 |
# Prepare the input array for prediction
|
| 37 |
input_data = pd.DataFrame({
|
|
|
|
|
|
|
| 38 |
'year_drafted': year_drafted,
|
| 39 |
'qb_num_picked': qb_num_picked,
|
| 40 |
'rd_picked': rd_picked,
|
|
|
|
| 69 |
interface = gr.Interface(
|
| 70 |
fn=predict,
|
| 71 |
inputs=[
|
|
|
|
| 72 |
gr.Textbox(label="Year Drafted"),
|
| 73 |
gr.Textbox(label="QB Number Picked"),
|
| 74 |
gr.Textbox(label="Round Picked"),
|