James McCool
commited on
Commit
·
afd608a
1
Parent(s):
3ca2ebf
adjusting finish percentile to scale
Browse files
global_func/predict_dupes.py
CHANGED
|
@@ -430,6 +430,15 @@ def predict_dupes(portfolio, maps_dict, site_var, type_var, Contest_Size, streng
|
|
| 430 |
|
| 431 |
portfolio['Finish_percentile'] = portfolio['Finish_percentile'] + .005 + (.005 * (Contest_Size / 10000))
|
| 432 |
portfolio['Finish_percentile'] = portfolio['Finish_percentile'] * percentile_multiplier * (portfolio['Own'] / (100 + (Contest_Size / 1000)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
portfolio['Win%'] = portfolio['Win%'] * (1 - portfolio['Finish_percentile'])
|
| 434 |
portfolio['Win%'] = portfolio['Win%'].clip(lower=0, upper=max_allowed_win)
|
| 435 |
|
|
|
|
| 430 |
|
| 431 |
portfolio['Finish_percentile'] = portfolio['Finish_percentile'] + .005 + (.005 * (Contest_Size / 10000))
|
| 432 |
portfolio['Finish_percentile'] = portfolio['Finish_percentile'] * percentile_multiplier * (portfolio['Own'] / (100 + (Contest_Size / 1000)))
|
| 433 |
+
|
| 434 |
+
# Check if max Finish_percentile is greater than 50% and scale if needed
|
| 435 |
+
max_finish_percentile = portfolio['Finish_percentile'].max()
|
| 436 |
+
if max_finish_percentile > 0.50:
|
| 437 |
+
# Scale between 0.01% (0.0001) and 50% (0.50)
|
| 438 |
+
min_val = portfolio['Finish_percentile'].min()
|
| 439 |
+
max_val = portfolio['Finish_percentile'].max()
|
| 440 |
+
portfolio['Finish_percentile'] = 0.0001 + (portfolio['Finish_percentile'] - min_val) / (max_val - min_val) * (0.50 - 0.0001)
|
| 441 |
+
|
| 442 |
portfolio['Win%'] = portfolio['Win%'] * (1 - portfolio['Finish_percentile'])
|
| 443 |
portfolio['Win%'] = portfolio['Win%'].clip(lower=0, upper=max_allowed_win)
|
| 444 |
|