James McCool
commited on
Commit
·
eaaec23
1
Parent(s):
cd430db
Remove table display in 'app.py' and adjust dupes calculation in 'predict_dupes.py' to include a new scaling factor for CPT_Own_percent_rank, enhancing prediction accuracy.
Browse files- app.py +1 -1
- global_func/predict_dupes.py +1 -0
app.py
CHANGED
|
@@ -1175,7 +1175,7 @@ if selected_tab == 'Manage Portfolio':
|
|
| 1175 |
st.session_state['working_frame'] = st.session_state['base_frame'].copy()
|
| 1176 |
# st.session_state['highest_owned_teams'] = st.session_state['projections_df'][~st.session_state['projections_df']['position'].isin(['P', 'SP'])].groupby('team')['ownership'].sum().sort_values(ascending=False).head(3).index.tolist()
|
| 1177 |
# st.session_state['highest_owned_pitchers'] = st.session_state['projections_df'][st.session_state['projections_df']['position'].isin(['P', 'SP'])]['player_names'].sort_values(by='ownership', ascending=False).head(3).tolist()
|
| 1178 |
-
st.table(check_frame)
|
| 1179 |
|
| 1180 |
if 'trimming_dict_maxes' not in st.session_state:
|
| 1181 |
st.session_state['trimming_dict_maxes'] = {
|
|
|
|
| 1175 |
st.session_state['working_frame'] = st.session_state['base_frame'].copy()
|
| 1176 |
# st.session_state['highest_owned_teams'] = st.session_state['projections_df'][~st.session_state['projections_df']['position'].isin(['P', 'SP'])].groupby('team')['ownership'].sum().sort_values(ascending=False).head(3).index.tolist()
|
| 1177 |
# st.session_state['highest_owned_pitchers'] = st.session_state['projections_df'][st.session_state['projections_df']['position'].isin(['P', 'SP'])]['player_names'].sort_values(by='ownership', ascending=False).head(3).tolist()
|
| 1178 |
+
# st.table(check_frame)
|
| 1179 |
|
| 1180 |
if 'trimming_dict_maxes' not in st.session_state:
|
| 1181 |
st.session_state['trimming_dict_maxes'] = {
|
global_func/predict_dupes.py
CHANGED
|
@@ -194,6 +194,7 @@ def predict_dupes(portfolio, maps_dict, site_var, type_var, Contest_Size, streng
|
|
| 194 |
portfolio['dupes_calc'] = ((portfolio['own_product'] + ((portfolio['CPT_Own_percent_rank'] - .50) / 1000) + ((portfolio['Own'] / 6) / (max_salary / 2))) * portfolio['avg_own_rank']) * Contest_Size + ((portfolio['salary'] - (max_salary - portfolio['Own'])) / 100) - ((max_salary - portfolio['salary']) / 100)
|
| 195 |
portfolio['dupes_calc'] = portfolio['dupes_calc'] * dupes_multiplier * (portfolio['Own'] / (own_baseline + (Contest_Size / 1000)))
|
| 196 |
portfolio['dupes_calc'] = ((((portfolio['salary'] / (max_salary * 0.96)) - 1)*(max_salary / 10000)) + 1) * portfolio['dupes_calc']
|
|
|
|
| 197 |
|
| 198 |
# Round and handle negative values
|
| 199 |
portfolio['Dupes'] = np.where(
|
|
|
|
| 194 |
portfolio['dupes_calc'] = ((portfolio['own_product'] + ((portfolio['CPT_Own_percent_rank'] - .50) / 1000) + ((portfolio['Own'] / 6) / (max_salary / 2))) * portfolio['avg_own_rank']) * Contest_Size + ((portfolio['salary'] - (max_salary - portfolio['Own'])) / 100) - ((max_salary - portfolio['salary']) / 100)
|
| 195 |
portfolio['dupes_calc'] = portfolio['dupes_calc'] * dupes_multiplier * (portfolio['Own'] / (own_baseline + (Contest_Size / 1000)))
|
| 196 |
portfolio['dupes_calc'] = ((((portfolio['salary'] / (max_salary * 0.96)) - 1)*(max_salary / 10000)) + 1) * portfolio['dupes_calc']
|
| 197 |
+
portfolio['dupes_calc'] = portfolio['dupes_calc'] * ((portfolio['CPT_Own_percent_rank'] + .50) / 2)
|
| 198 |
|
| 199 |
# Round and handle negative values
|
| 200 |
portfolio['Dupes'] = np.where(
|