James McCool commited on
Commit
a9ee089
·
2 Parent(s): ceb105f 06ca2c8

Merge branch 'main' of https://huggingface.co/spaces/Multichem-PD/LOL_Matchups_Model

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -145,7 +145,7 @@ with st.sidebar:
145
  key=f"deaths_{game_num}"
146
  ))
147
 
148
- @st.cache_data()
149
  def simulate_stats(row, num_sims=1000):
150
  """Simulate stats using normal distribution"""
151
  # Using coefficient of variation of 0.3 to generate reasonable standard deviations
@@ -585,6 +585,11 @@ def init_player_data(players, opponent, win_loss_settings, kill_predictions, dea
585
 
586
  return overall_team_data.dropna().set_index('playername'), opp_boosts, results_dict
587
 
 
 
 
 
 
588
  if st.button("Run"):
589
  if data_type == "Team":
590
  team_data, opp_boost, results_dict = init_team_data(selected_team, selected_opponent, win_loss_settings, kill_predictions, death_predictions, start_date, end_date)
 
145
  key=f"deaths_{game_num}"
146
  ))
147
 
148
+ @st.cache_data(ttl = 60)
149
  def simulate_stats(row, num_sims=1000):
150
  """Simulate stats using normal distribution"""
151
  # Using coefficient of variation of 0.3 to generate reasonable standard deviations
 
585
 
586
  return overall_team_data.dropna().set_index('playername'), opp_boosts, results_dict
587
 
588
+ if st.button("Load/Reset Data", key='reset1'):
589
+ st.cache_data.clear()
590
+ for key in st.session_state.keys():
591
+ del st.session_state[key]
592
+
593
  if st.button("Run"):
594
  if data_type == "Team":
595
  team_data, opp_boost, results_dict = init_team_data(selected_team, selected_opponent, win_loss_settings, kill_predictions, death_predictions, start_date, end_date)