James McCool commited on
Commit
8c81703
·
1 Parent(s): dca21a5

Update preset options in app.py to improve lineup generation accuracy. Changed 'Large Field (Finish Percentile / Edge)' to 'Large Field (Manage Similarity)' and adjusted corresponding logic in the form submission process.

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. global_func/large_field_preset.py +1 -0
app.py CHANGED
@@ -1111,13 +1111,13 @@ with tab2:
1111
  with st.expander('Presets'):
1112
  st.info("Still heavily in testing here, I'll announce when they are ready for use.")
1113
  with st.form(key='Small Field Preset'):
1114
- preset_choice = st.selectbox("Preset", options=['Small Field (Heavy Own)', 'Large Field (Finish Percentile / Edge)', 'Hedge Chalk (Manage Leverage)'], index=0)
1115
  lineup_target = st.number_input("Lineups to produce", value=150, min_value=1, step=1)
1116
  submitted = st.form_submit_button("Submit")
1117
  if submitted:
1118
  if preset_choice == 'Small Field (Heavy Own)':
1119
  parsed_frame = small_field_preset(st.session_state['working_frame'], lineup_target, excluded_cols)
1120
- elif preset_choice == 'Large Field (Finish Percentile / Edge)':
1121
  parsed_frame = large_field_preset(st.session_state['working_frame'], lineup_target, excluded_cols)
1122
  elif preset_choice == 'Hedge Chalk (Manage Leverage)':
1123
  parsed_frame = hedging_preset(st.session_state['working_frame'], lineup_target, st.session_state['projections_df'])
 
1111
  with st.expander('Presets'):
1112
  st.info("Still heavily in testing here, I'll announce when they are ready for use.")
1113
  with st.form(key='Small Field Preset'):
1114
+ preset_choice = st.selectbox("Preset", options=['Small Field (Heavy Own)', 'Large Field (Manage Similarity)', 'Hedge Chalk (Manage Leverage)'], index=0)
1115
  lineup_target = st.number_input("Lineups to produce", value=150, min_value=1, step=1)
1116
  submitted = st.form_submit_button("Submit")
1117
  if submitted:
1118
  if preset_choice == 'Small Field (Heavy Own)':
1119
  parsed_frame = small_field_preset(st.session_state['working_frame'], lineup_target, excluded_cols)
1120
+ elif preset_choice == 'Large Field (Manage Similarity)':
1121
  parsed_frame = large_field_preset(st.session_state['working_frame'], lineup_target, excluded_cols)
1122
  elif preset_choice == 'Hedge Chalk (Manage Leverage)':
1123
  parsed_frame = hedging_preset(st.session_state['working_frame'], lineup_target, st.session_state['projections_df'])
global_func/large_field_preset.py CHANGED
@@ -7,6 +7,7 @@ def large_field_preset(portfolio: pd.DataFrame, lineup_target: int, exclude_cols
7
 
8
  concat_portfolio = portfolio.copy()
9
  concat_portfolio = concat_portfolio.sort_values(by='Similarity Score', ascending=True).reset_index(drop=True)
 
10
 
11
  # Calculate target similarity scores for linear progression
12
  similarity_floor = concat_portfolio['Similarity Score'].min()
 
7
 
8
  concat_portfolio = portfolio.copy()
9
  concat_portfolio = concat_portfolio.sort_values(by='Similarity Score', ascending=True).reset_index(drop=True)
10
+ concat_portfolio = concat_portfolio[concat_portfolio['Lineup Edge'] > 0]
11
 
12
  # Calculate target similarity scores for linear progression
13
  similarity_floor = concat_portfolio['Similarity Score'].min()