Jimin Park commited on
Commit
c0b5eb8
·
1 Parent(s): f0455e3

added new structure

Browse files
Files changed (1) hide show
  1. util/app.py +24 -24
util/app.py CHANGED
@@ -123,30 +123,30 @@ def show_stats(player_opgg_url):
123
 
124
  # Extract additional stats
125
  playstyle = training_features['playstyle'].mode()[0] if 'playstyle' in training_features else 'N/A'
126
- print("processed playstyle\n")
127
- role_specialization = training_features['role_specialization'].mode()[0] if 'role_specialization' in training_features else 'N/A' # Most common role
128
- print("processed role_specialization\n")
129
- champion_loyalty_score = training_features['champion_loyalty_score'].mean().round(2) if 'champion_loyalty_score' in training_features else 'N/A' # Average loyalty
130
- print("processed champion_loyalty_score\n")
131
 
132
  # Map numeric playstyle to descriptive text
133
- playstyle_mapping = {
134
- 0: "Assassin/Carry",
135
- 1: "Support/Utility",
136
- 2: "Tank/Initiator",
137
- 3: "Split-pusher",
138
- 4: "Aggressive/Fighter",
139
- 5: "Undefined"
140
- }
141
 
142
- role_specialization_map = {
143
- 0: "Pure Specialist",
144
- 1: "Strong Dual Role",
145
- 2: "Primary Role with Backups",
146
- 3: "Role Swapper",
147
- 4: "True Flex",
148
- 5: "Undefined"
149
- }
150
 
151
  stats_html = f"""
152
  <div style='padding: 20px; background: #f5f5f5; border-radius: 10px;'>
@@ -154,11 +154,11 @@ def show_stats(player_opgg_url):
154
  <p>Wins: {wins} | Losses: {losses}</p>
155
  <p>Winrate: {winrate}</p>
156
  <p>Favorite Champions: {', '.join(favorite_champions)}</p>
157
- <p>Playstyle: {playstyle_mapping.get(playstyle, 'N/A')}</p>
158
- <p>Role Specialization: {role_specialization_map.get(role_specialization, 'N/A')}</p>
159
- <p>Champion Loyalty Score: {champion_loyalty_score}</p>
160
  </div>
161
  """
 
 
 
162
 
163
  return stats_html, None
164
  except Exception as e:
 
123
 
124
  # Extract additional stats
125
  playstyle = training_features['playstyle'].mode()[0] if 'playstyle' in training_features else 'N/A'
126
+ # print("processed playstyle.\n")
127
+ # role_specialization = training_features['role_specialization'].mode()[0] if 'role_specialization' in training_features else 'N/A' # Most common role
128
+ # print("processed role_specialization.\n")
129
+ # champion_loyalty_score = training_features['champion_loyalty_score'].mean().round(2) if 'champion_loyalty_score' in training_features else 'N/A' # Average loyalty
130
+ # print("processed champion_loyalty_score.\n")
131
 
132
  # Map numeric playstyle to descriptive text
133
+ # playstyle_mapping = {
134
+ # 0: "Assassin/Carry",
135
+ # 1: "Support/Utility",
136
+ # 2: "Tank/Initiator",
137
+ # 3: "Split-pusher",
138
+ # 4: "Aggressive/Fighter",
139
+ # 5: "Undefined"
140
+ # }
141
 
142
+ # role_specialization_map = {
143
+ # 0: "Pure Specialist",
144
+ # 1: "Strong Dual Role",
145
+ # 2: "Primary Role with Backups",
146
+ # 3: "Role Swapper",
147
+ # 4: "True Flex",
148
+ # 5: "Undefined"
149
+ # }
150
 
151
  stats_html = f"""
152
  <div style='padding: 20px; background: #f5f5f5; border-radius: 10px;'>
 
154
  <p>Wins: {wins} | Losses: {losses}</p>
155
  <p>Winrate: {winrate}</p>
156
  <p>Favorite Champions: {', '.join(favorite_champions)}</p>
 
 
 
157
  </div>
158
  """
159
+ # <p>Playstyle: {playstyle_mapping.get(playstyle, 'N/A')}</p>
160
+ # <p>Role Specialization: {role_specialization_map.get(role_specialization, 'N/A')}</p>
161
+ # <p>Champion Loyalty Score: {champion_loyalty_score}</p>
162
 
163
  return stats_html, None
164
  except Exception as e: