Spaces:
Sleeping
Sleeping
Jimin Park
commited on
Commit
·
b734de7
1
Parent(s):
3114e9c
added new structure
Browse files- util/app.py +7 -3
util/app.py
CHANGED
@@ -120,6 +120,7 @@ def show_stats(player_opgg_url):
|
|
120 |
.head(3)
|
121 |
.index.tolist()
|
122 |
)
|
|
|
123 |
|
124 |
stats_html = f"""
|
125 |
<div style='padding: 20px; background: #f5f5f5; border-radius: 10px;'>
|
@@ -127,6 +128,7 @@ def show_stats(player_opgg_url):
|
|
127 |
<p>Wins: {wins} | Losses: {losses}</p>
|
128 |
<p>Winrate: {winrate}</p>
|
129 |
<p>Favorite Champions: {', '.join(favorite_champions)}</p>
|
|
|
130 |
</div>
|
131 |
"""
|
132 |
|
@@ -213,11 +215,13 @@ def predict_top_5_champion_w_confidence(player_opgg_url, *champions):
|
|
213 |
|
214 |
results['Prediction_Rank'] = results.apply(find_champion_rank, axis=1)
|
215 |
# Select the last row and specific columns
|
216 |
-
latest_result = results.iloc[-1][["Rank_1_Champion", "Rank_2_Champion", "Rank_3_Champion"]]
|
217 |
|
218 |
-
|
|
|
|
|
219 |
|
220 |
-
return
|
221 |
|
222 |
except Exception as e:
|
223 |
print(f"Error getting top 5 champions: {e}")
|
|
|
120 |
.head(3)
|
121 |
.index.tolist()
|
122 |
)
|
123 |
+
playstyle = training_features['playstyle']
|
124 |
|
125 |
stats_html = f"""
|
126 |
<div style='padding: 20px; background: #f5f5f5; border-radius: 10px;'>
|
|
|
128 |
<p>Wins: {wins} | Losses: {losses}</p>
|
129 |
<p>Winrate: {winrate}</p>
|
130 |
<p>Favorite Champions: {', '.join(favorite_champions)}</p>
|
131 |
+
<p>Playstyle: {playstyle}</p>
|
132 |
</div>
|
133 |
"""
|
134 |
|
|
|
215 |
|
216 |
results['Prediction_Rank'] = results.apply(find_champion_rank, axis=1)
|
217 |
# Select the last row and specific columns
|
218 |
+
latest_result = results.iloc[-1][["Rank_1_Champion", "Rank_2_Champion", "Rank_3_Champion"]].tolist()
|
219 |
|
220 |
+
latest_result = results.iloc[-1][["Rank_1_Champion", "Rank_2_Champion", "Rank_3_Champion"]]
|
221 |
+
clean_output = "\n".join(f"{col}: {val}" for col, val in latest_result.items())
|
222 |
+
print(clean_output)
|
223 |
|
224 |
+
return clean_output+
|
225 |
|
226 |
except Exception as e:
|
227 |
print(f"Error getting top 5 champions: {e}")
|