Spaces:
Sleeping
Sleeping
Jimin Park
commited on
Commit
·
e1658f2
1
Parent(s):
c14957a
added new structure
Browse files- util/app.py +14 -5
util/app.py
CHANGED
@@ -120,15 +120,24 @@ def show_stats(player_opgg_url):
|
|
120 |
.head(3)
|
121 |
.index.tolist()
|
122 |
)
|
123 |
-
|
|
|
|
|
|
|
|
|
124 |
|
|
|
125 |
stats_html = f"""
|
126 |
<div style='padding: 20px; background: #f5f5f5; border-radius: 10px;'>
|
127 |
<h3>Player's Recent Stats</h3>
|
128 |
-
<p>Wins
|
129 |
-
<p>Winrate
|
130 |
-
<p>Favorite Champions
|
131 |
-
<
|
|
|
|
|
|
|
|
|
132 |
</div>
|
133 |
"""
|
134 |
|
|
|
120 |
.head(3)
|
121 |
.index.tolist()
|
122 |
)
|
123 |
+
|
124 |
+
# Extract additional stats
|
125 |
+
playstyle = training_features['playstyle'].mode()[0] # Most common playstyle
|
126 |
+
role_specialization = training_features['role_specialization'].mode()[0] # Most common role
|
127 |
+
champion_loyalty_score = training_features['champion_loyalty_score'].mean().round(2) # Average loyalty
|
128 |
|
129 |
+
# Updated HTML display
|
130 |
stats_html = f"""
|
131 |
<div style='padding: 20px; background: #f5f5f5; border-radius: 10px;'>
|
132 |
<h3>Player's Recent Stats</h3>
|
133 |
+
<p><strong>Wins:</strong> {wins} | <strong>Losses:</strong> {losses}</p>
|
134 |
+
<p><strong>Winrate:</strong> {winrate}</p>
|
135 |
+
<p><strong>Favorite Champions:</strong> {', '.join(map(str, favorite_champions))}</p>
|
136 |
+
<hr>
|
137 |
+
<h4>Additional Insights</h4>
|
138 |
+
<p><strong>Playstyle:</strong> {playstyle}</p>
|
139 |
+
<p><strong>Role Specialization:</strong> {role_specialization}</p>
|
140 |
+
<p><strong>Champion Loyalty Score:</strong> {champion_loyalty_score}</p>
|
141 |
</div>
|
142 |
"""
|
143 |
|