James McCool commited on
Commit
b452fab
·
1 Parent(s): d148196

Adjust lineups_to_remove calculation in exposure_spread function to apply a 101% factor, refining accuracy in lineup adjustments based on player exposure and target.

Browse files
Files changed (1) hide show
  1. global_func/exposure_spread.py +2 -2
global_func/exposure_spread.py CHANGED
@@ -240,7 +240,7 @@ def exposure_spread(working_frame, exposure_player, exposure_target, exposure_st
240
  player_exposure = player_mask.sum() / len(working_frame)
241
 
242
  # find the number of lineups that need to be removed to reach the target exposure
243
- lineups_to_remove = ((player_exposure - exposure_target) * len(working_frame)) * 1.05
244
 
245
  # isolate the rows that contain the player
246
  player_rows = working_frame[player_mask]
@@ -252,7 +252,7 @@ def exposure_spread(working_frame, exposure_player, exposure_target, exposure_st
252
  random_row_indices = list(player_rows.index)
253
  random.shuffle(random_row_indices)
254
 
255
- # for each row to the the number of lineups to remove, replace with random choice from comparable player list
256
  for row in random_row_indices:
257
  if change_counter < math.ceil(lineups_to_remove):
258
  comparable_players = projections_df[
 
240
  player_exposure = player_mask.sum() / len(working_frame)
241
 
242
  # find the number of lineups that need to be removed to reach the target exposure
243
+ lineups_to_remove = ((player_exposure - exposure_target) * len(working_frame)) * 1.01
244
 
245
  # isolate the rows that contain the player
246
  player_rows = working_frame[player_mask]
 
252
  random_row_indices = list(player_rows.index)
253
  random.shuffle(random_row_indices)
254
 
255
+ # for each row to the the number of lineups to remove, replace with random choice from comparable player list if they can be inserted
256
  for row in random_row_indices:
257
  if change_counter < math.ceil(lineups_to_remove):
258
  comparable_players = projections_df[