Spaces:
Sleeping
Sleeping
fifa19_streamlit
Browse files
app.py
CHANGED
@@ -121,30 +121,32 @@ def final_pred(num_of_players,b=[],c=[],d=[]):
|
|
121 |
def main():
|
122 |
st.title("FIFA 19 Player Recommender 🎮⚽")
|
123 |
|
124 |
-
#
|
125 |
-
st.
|
126 |
-
### About this App
|
127 |
-
This FIFA 19 Player Recommender helps football clubs and managers identify similar players and predict their market value.
|
128 |
-
It's particularly useful for:
|
129 |
-
- Scouting potential replacements for current players
|
130 |
-
- Finding undervalued talents in the market
|
131 |
-
- Discovering players that match your team's playing style
|
132 |
-
- Making informed decisions about player acquisitions
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
|
149 |
# Sidebar inputs
|
150 |
st.sidebar.header("Search Parameters")
|
@@ -159,22 +161,21 @@ def main():
|
|
159 |
age_up = st.sidebar.slider("Maximum Age", 16, 45, 30)
|
160 |
|
161 |
if st.sidebar.button("Get Recommendations"):
|
162 |
-
with
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
""")
|
178 |
|
179 |
if __name__ == '__main__':
|
180 |
main()
|
|
|
121 |
def main():
|
122 |
st.title("FIFA 19 Player Recommender 🎮⚽")
|
123 |
|
124 |
+
# Create two columns - one for instructions and one for results
|
125 |
+
left_col, right_col = st.columns([1, 1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
+
with left_col:
|
128 |
+
# Add business context and description
|
129 |
+
st.markdown("""
|
130 |
+
### About this App
|
131 |
+
This FIFA 19 Player Recommender helps football clubs and managers identify similar players and predict their market value.
|
132 |
+
It's particularly useful for:
|
133 |
+
- Scouting potential replacements for current players
|
134 |
+
- Finding undervalued talents in the market
|
135 |
+
- Discovering players that match your team's playing style
|
136 |
+
- Making informed decisions about player acquisitions
|
137 |
+
|
138 |
+
### How it Works
|
139 |
+
1. The app uses advanced machine learning to analyze player attributes and find similar players
|
140 |
+
2. It considers over 70 different player statistics and characteristics
|
141 |
+
3. Provides market value predictions to help with transfer budget planning
|
142 |
+
|
143 |
+
### How to Use
|
144 |
+
1. **Select Your Team** from the sidebar - this helps find players that would fit your team's style
|
145 |
+
2. **Choose Position** you're looking to fill
|
146 |
+
3. **Adjust Number of Recommendations** (1-10 players)
|
147 |
+
4. **Set Maximum Age** to focus on your preferred age range
|
148 |
+
5. Click "Get Recommendations" to see your matches!
|
149 |
+
""")
|
150 |
|
151 |
# Sidebar inputs
|
152 |
st.sidebar.header("Search Parameters")
|
|
|
161 |
age_up = st.sidebar.slider("Maximum Age", 16, 45, 30)
|
162 |
|
163 |
if st.sidebar.button("Get Recommendations"):
|
164 |
+
with right_col:
|
165 |
+
with st.spinner("Finding similar players..."):
|
166 |
+
recommendations = player_sim_team(team_chosen, postion_chosen, num_of_players, age_up)
|
167 |
+
|
168 |
+
# Display results in a nice format
|
169 |
+
st.subheader(f"Recommended Players for {team_chosen} - {postion_chosen}")
|
170 |
+
|
171 |
+
# Create a container for recommendations
|
172 |
+
for player in recommendations:
|
173 |
+
with st.container():
|
174 |
+
st.markdown(f"""
|
175 |
+
### {player['player_name']}
|
176 |
+
**Estimated Value:** €{player['starting_bid']:,.2f}
|
177 |
+
---
|
178 |
+
""")
|
|
|
179 |
|
180 |
if __name__ == '__main__':
|
181 |
main()
|