James McCool
commited on
Commit
·
64aecc7
1
Parent(s):
b812729
more adjustments to the way finishing percentiles are handled
Browse files
global_func/predict_dupes.py
CHANGED
|
@@ -436,11 +436,12 @@ def predict_dupes(portfolio, maps_dict, site_var, type_var, Contest_Size, streng
|
|
| 436 |
|
| 437 |
# Check if max Finish_percentile is greater than 50% and scale if needed
|
| 438 |
max_finish_percentile = portfolio['Finish_percentile'].max()
|
|
|
|
| 439 |
if max_finish_percentile > 0.50:
|
| 440 |
# Scale between 0.01% (0.0001) and 50% (0.50)
|
| 441 |
min_val = portfolio['Finish_percentile'].min()
|
| 442 |
max_val = portfolio['Finish_percentile'].max()
|
| 443 |
-
portfolio['Finish_percentile'] = 0.0001 + (portfolio['Finish_percentile'] - min_val) / (max_val - min_val) * (0.50 - 0.0001)
|
| 444 |
|
| 445 |
portfolio['Win%'] = portfolio['Win%'] * (1 - portfolio['Finish_percentile'])
|
| 446 |
portfolio['Win%'] = portfolio['Win%'].clip(lower=0, upper=max_allowed_win)
|
|
|
|
| 436 |
|
| 437 |
# Check if max Finish_percentile is greater than 50% and scale if needed
|
| 438 |
max_finish_percentile = portfolio['Finish_percentile'].max()
|
| 439 |
+
finish_rate_additive = max(min((Contest_Size / 10000), .25), .01)
|
| 440 |
if max_finish_percentile > 0.50:
|
| 441 |
# Scale between 0.01% (0.0001) and 50% (0.50)
|
| 442 |
min_val = portfolio['Finish_percentile'].min()
|
| 443 |
max_val = portfolio['Finish_percentile'].max()
|
| 444 |
+
portfolio['Finish_percentile'] = 0.0001 + (portfolio['Finish_percentile'] - min_val) / (max_val - min_val) * (0.50 - finish_rate_additive - 0.0001)
|
| 445 |
|
| 446 |
portfolio['Win%'] = portfolio['Win%'] * (1 - portfolio['Finish_percentile'])
|
| 447 |
portfolio['Win%'] = portfolio['Win%'].clip(lower=0, upper=max_allowed_win)
|