James McCool commited on
Commit
f135d43
·
1 Parent(s): 7474807

Enhance player prop analysis by introducing 'over_adj' and 'under_adj' adjustments in Bet_check calculations. This update improves the accuracy of betting suggestions by factoring in adjusted outcomes based on player performance metrics. Refined DataFrame calculations ensure better decision-making in simulations.

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -594,6 +594,8 @@ with tab6:
594
  players_only['Prop'] = players_only['Player'].map(prop_dict)
595
  players_only['Trending Over'] = players_only['Player'].map(trending_over_dict)
596
  players_only['Trending Under'] = players_only['Player'].map(trending_under_dict)
 
 
597
  players_only['poisson_var'] = players_only.apply(calculate_poisson, axis=1)
598
  players_only['10%'] = overall_file.quantile(0.1, axis=1)
599
  players_only['90%'] = overall_file.quantile(0.9, axis=1)
@@ -608,7 +610,7 @@ with tab6:
608
  players_only = players_only[players_only['Mean_Outcome'] > 0]
609
  players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
610
  players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
611
- players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] , players_only['Under_diff'])
612
  players_only['Bet_suggest'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], "Over" , "Under")
613
  players_only['Bet?'] = np.where(players_only['Bet_check'] >= players_only['prop_threshold'], players_only['Bet_suggest'], "No Bet")
614
  players_only['Edge'] = players_only['Bet_check']
@@ -746,6 +748,8 @@ with tab6:
746
  players_only['Prop'] = players_only['Player'].map(prop_dict)
747
  players_only['Trending Over'] = players_only['Player'].map(trending_over_dict)
748
  players_only['Trending Under'] = players_only['Player'].map(trending_under_dict)
 
 
749
  players_only['poisson_var'] = players_only.apply(calculate_poisson, axis=1)
750
  players_only['10%'] = overall_file.quantile(0.1, axis=1)
751
  players_only['90%'] = overall_file.quantile(0.9, axis=1)
@@ -760,7 +764,7 @@ with tab6:
760
  players_only = players_only[players_only['Mean_Outcome'] > 0]
761
  players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
762
  players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
763
- players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] , players_only['Under_diff'])
764
  players_only['Bet_suggest'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], "Over" , "Under")
765
  players_only['Bet?'] = np.where(players_only['Bet_check'] >= players_only['prop_threshold'], players_only['Bet_suggest'], "No Bet")
766
  players_only['Edge'] = players_only['Bet_check']
 
594
  players_only['Prop'] = players_only['Player'].map(prop_dict)
595
  players_only['Trending Over'] = players_only['Player'].map(trending_over_dict)
596
  players_only['Trending Under'] = players_only['Player'].map(trending_under_dict)
597
+ players_only['over_adj'] = np_where((players_only['Mean_Outcome'] - players_only['Prop']) > 0, 1, (players_only['Mean_Outcome'] / players_only['Prop']))
598
+ players_only['under_adj'] = np_where((players_only['Prop'] - players_only['Mean_Outcome']) > 0, 1, (players_only['Prop'] / players_only['Mean_Outcome']))
599
  players_only['poisson_var'] = players_only.apply(calculate_poisson, axis=1)
600
  players_only['10%'] = overall_file.quantile(0.1, axis=1)
601
  players_only['90%'] = overall_file.quantile(0.9, axis=1)
 
610
  players_only = players_only[players_only['Mean_Outcome'] > 0]
611
  players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
612
  players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
613
+ players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] * players_only['over_adj'], players_only['Under_diff'] * players_only['under_adj'])
614
  players_only['Bet_suggest'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], "Over" , "Under")
615
  players_only['Bet?'] = np.where(players_only['Bet_check'] >= players_only['prop_threshold'], players_only['Bet_suggest'], "No Bet")
616
  players_only['Edge'] = players_only['Bet_check']
 
748
  players_only['Prop'] = players_only['Player'].map(prop_dict)
749
  players_only['Trending Over'] = players_only['Player'].map(trending_over_dict)
750
  players_only['Trending Under'] = players_only['Player'].map(trending_under_dict)
751
+ players_only['over_adj'] = np_where((players_only['Mean_Outcome'] - players_only['Prop']) > 0, 1, (players_only['Mean_Outcome'] / players_only['Prop']))
752
+ players_only['under_adj'] = np_where((players_only['Prop'] - players_only['Mean_Outcome']) > 0, 1, (players_only['Prop'] / players_only['Mean_Outcome']))
753
  players_only['poisson_var'] = players_only.apply(calculate_poisson, axis=1)
754
  players_only['10%'] = overall_file.quantile(0.1, axis=1)
755
  players_only['90%'] = overall_file.quantile(0.9, axis=1)
 
764
  players_only = players_only[players_only['Mean_Outcome'] > 0]
765
  players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
766
  players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
767
+ players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] * players_only['over_adj'], players_only['Under_diff'] * players_only['under_adj'])
768
  players_only['Bet_suggest'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], "Over" , "Under")
769
  players_only['Bet?'] = np.where(players_only['Bet_check'] >= players_only['prop_threshold'], players_only['Bet_suggest'], "No Bet")
770
  players_only['Edge'] = players_only['Bet_check']