Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,9 +14,13 @@ mlp_model = load(open('mlp_classifier.pkl', 'rb'))
|
|
14 |
my_scaler = load(open('scaler.pkl', 'rb'))
|
15 |
hot_enc_scaler = load(open('hot_enc.pkl', 'rb'))
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
#pre-processing:
|
19 |
-
numerical_features = [[age,height_cm,weight_kg,
|
20 |
catagorical_features = [[nationality,club]]
|
21 |
numerical_features = my_scaler.transform(numerical_features)
|
22 |
catagorical_features = hot_enc_scaler.transform(catagorical_features).toarray()
|
@@ -29,7 +33,10 @@ def predict_value(age,height_cm,weight_kg,overall,potential,nationality,club):
|
|
29 |
demo = gr.Interface(
|
30 |
fn=predict_value,
|
31 |
inputs=[gr.Slider(15, 60),gr.Slider(100, 200),gr.Slider(0, 100),gr.Slider(0, 100),gr.Slider(0, 100),
|
32 |
-
gr.inputs.Dropdown(["Argentina" , "Saudi Arabia", "England"
|
33 |
-
gr.inputs.Dropdown(["FC Barcelona" , "Juventus", "Liverpool"
|
34 |
-
outputs=[
|
|
|
|
|
|
|
35 |
demo.launch()
|
|
|
14 |
my_scaler = load(open('scaler.pkl', 'rb'))
|
15 |
hot_enc_scaler = load(open('hot_enc.pkl', 'rb'))
|
16 |
|
17 |
+
description = '''
|
18 |
+
This small prototype is using Big Data and AI to provide an accurate estimate of FootBall player net worth in euros.
|
19 |
+
'''
|
20 |
+
|
21 |
+
def predict_value(age,height_cm,weight_kg,overall_skill,potential_skill,nationality,club):
|
22 |
#pre-processing:
|
23 |
+
numerical_features = [[age,height_cm,weight_kg,overall_skill,potential_skill]]
|
24 |
catagorical_features = [[nationality,club]]
|
25 |
numerical_features = my_scaler.transform(numerical_features)
|
26 |
catagorical_features = hot_enc_scaler.transform(catagorical_features).toarray()
|
|
|
33 |
demo = gr.Interface(
|
34 |
fn=predict_value,
|
35 |
inputs=[gr.Slider(15, 60),gr.Slider(100, 200),gr.Slider(0, 100),gr.Slider(0, 100),gr.Slider(0, 100),
|
36 |
+
gr.inputs.Dropdown(["Argentina" , "Saudi Arabia", "England"]),
|
37 |
+
gr.inputs.Dropdown(["FC Barcelona" , "Juventus", "Liverpool"])],
|
38 |
+
outputs=[gr.Number(label='Net Worth (Euros)')],
|
39 |
+
title= "TalentAI - Estimate FB Player Value (Eur)",
|
40 |
+
description = description,
|
41 |
+
article = "Abdulaziz Alakooz developed this prototype as part of Thkaa AI in sports contest - August 2022.")
|
42 |
demo.launch()
|