James McCool commited on
Commit
7b2935a
·
1 Parent(s): b40a05d

Enhance reassess_edge function by adding max_salary parameter to improve salary handling in the predict_dupes call, ensuring more accurate edge reassessment.

Browse files
Files changed (1) hide show
  1. global_func/reassess_edge.py +3 -2
global_func/reassess_edge.py CHANGED
@@ -1,7 +1,7 @@
1
  import pandas as pd
2
  from global_func.predict_dupes import predict_dupes
3
 
4
- def reassess_edge(modified_frame: pd.DataFrame, base_frame: pd.DataFrame, maps_dict: dict, site_var: str, type_var: str, Contest_Size: int, strength_var: str, sport_var: str) -> pd.DataFrame:
5
  """
6
  Reassess edge by concatenating modified frame with base frame, running predict_dupes,
7
  and then extracting the first N rows (where N is the length of modified_frame).
@@ -15,6 +15,7 @@ def reassess_edge(modified_frame: pd.DataFrame, base_frame: pd.DataFrame, maps_d
15
  Contest_Size: Contest size for calculations
16
  strength_var: Strength variable (Weak/Average/Sharp)
17
  sport_var: Sport variable
 
18
 
19
  Returns:
20
  DataFrame: Updated modified_frame with recalculated metrics
@@ -26,7 +27,7 @@ def reassess_edge(modified_frame: pd.DataFrame, base_frame: pd.DataFrame, maps_d
26
  combined_frame = pd.concat([modified_frame, base_frame], ignore_index=True)
27
 
28
  # Run predict_dupes on the combined frame
29
- updated_combined_frame = predict_dupes(combined_frame, maps_dict, site_var, type_var, Contest_Size, strength_var, sport_var)
30
 
31
  # Extract the first N rows (which correspond to our modified frame)
32
  result_frame = updated_combined_frame.head(num_modified_rows).copy()
 
1
  import pandas as pd
2
  from global_func.predict_dupes import predict_dupes
3
 
4
+ def reassess_edge(modified_frame: pd.DataFrame, base_frame: pd.DataFrame, maps_dict: dict, site_var: str, type_var: str, Contest_Size: int, strength_var: str, sport_var: str, max_salary: int) -> pd.DataFrame:
5
  """
6
  Reassess edge by concatenating modified frame with base frame, running predict_dupes,
7
  and then extracting the first N rows (where N is the length of modified_frame).
 
15
  Contest_Size: Contest size for calculations
16
  strength_var: Strength variable (Weak/Average/Sharp)
17
  sport_var: Sport variable
18
+ max_salary: Maximum salary for the contest
19
 
20
  Returns:
21
  DataFrame: Updated modified_frame with recalculated metrics
 
27
  combined_frame = pd.concat([modified_frame, base_frame], ignore_index=True)
28
 
29
  # Run predict_dupes on the combined frame
30
+ updated_combined_frame = predict_dupes(combined_frame, maps_dict, site_var, type_var, Contest_Size, strength_var, sport_var, max_salary)
31
 
32
  # Extract the first N rows (which correspond to our modified frame)
33
  result_frame = updated_combined_frame.head(num_modified_rows).copy()