James McCool
commited on
Commit
·
cdfb6e5
1
Parent(s):
2b7d407
ping
Browse files- app.py +45 -45
- global_func/predict_dupes.py +1 -1
app.py
CHANGED
|
@@ -1296,60 +1296,60 @@ with tab2:
|
|
| 1296 |
st.session_state['export_base'] = parsed_frame.sort_values(by='median', ascending=False).reset_index(drop=True)
|
| 1297 |
st.session_state['export_merge'] = st.session_state['export_base'].copy()
|
| 1298 |
|
| 1299 |
-
with st.expander('Conditional Manager'):
|
| 1300 |
-
|
| 1301 |
-
|
| 1302 |
-
|
| 1303 |
-
|
| 1304 |
-
|
| 1305 |
-
|
| 1306 |
-
|
| 1307 |
-
|
| 1308 |
|
| 1309 |
-
|
| 1310 |
-
|
| 1311 |
-
|
| 1312 |
-
|
| 1313 |
-
|
| 1314 |
-
|
| 1315 |
-
|
| 1316 |
-
|
| 1317 |
-
|
| 1318 |
-
|
| 1319 |
-
|
| 1320 |
-
|
| 1321 |
-
|
| 1322 |
-
|
| 1323 |
-
|
| 1324 |
-
|
| 1325 |
|
| 1326 |
-
|
| 1327 |
-
|
| 1328 |
-
|
| 1329 |
|
| 1330 |
-
|
| 1331 |
|
| 1332 |
-
|
| 1333 |
-
|
| 1334 |
-
|
| 1335 |
-
|
| 1336 |
-
|
| 1337 |
|
| 1338 |
-
|
| 1339 |
|
| 1340 |
-
|
| 1341 |
-
|
| 1342 |
-
|
| 1343 |
-
|
| 1344 |
|
| 1345 |
-
|
| 1346 |
-
|
| 1347 |
-
|
| 1348 |
|
| 1349 |
-
|
| 1350 |
|
| 1351 |
-
|
| 1352 |
-
|
| 1353 |
|
| 1354 |
with st.expander('Trimming Options'):
|
| 1355 |
with st.form(key='trim_form'):
|
|
|
|
| 1296 |
st.session_state['export_base'] = parsed_frame.sort_values(by='median', ascending=False).reset_index(drop=True)
|
| 1297 |
st.session_state['export_merge'] = st.session_state['export_base'].copy()
|
| 1298 |
|
| 1299 |
+
# with st.expander('Conditional Manager'):
|
| 1300 |
+
# # a set of functions for removing lineups that contain a conditional between players and stacks
|
| 1301 |
+
# with st.form(key='conditional_manager_form'):
|
| 1302 |
+
# player_names = set()
|
| 1303 |
+
# for col in st.session_state['working_frame'].columns:
|
| 1304 |
+
# if col not in excluded_cols:
|
| 1305 |
+
# player_names.update(st.session_state['working_frame'][col].unique())
|
| 1306 |
+
# conditional_remove_players = st.multiselect("Remove lineups containing player(s):", options=sorted(list(player_names)), default=[])
|
| 1307 |
+
# conditional_include_players = st.multiselect("If they also contain player(s):", options=sorted(list(player_names)), default=[])
|
| 1308 |
|
| 1309 |
+
# submitted_col, export_col = st.columns(2)
|
| 1310 |
+
# st.info("Portfolio Button applies to your overall Portfolio, Export button applies to your Custom Export")
|
| 1311 |
+
# with submitted_col:
|
| 1312 |
+
# reg_submitted = st.form_submit_button("Portfolio")
|
| 1313 |
+
# with export_col:
|
| 1314 |
+
# exp_submitted = st.form_submit_button("Export")
|
| 1315 |
+
# if reg_submitted:
|
| 1316 |
+
# st.session_state['settings_base'] = False
|
| 1317 |
+
# parsed_frame = st.session_state['working_frame'].copy()
|
| 1318 |
+
|
| 1319 |
+
# player_columns = [col for col in parsed_frame.columns if col not in excluded_cols]
|
| 1320 |
+
|
| 1321 |
+
# # Test with a simpler approach
|
| 1322 |
+
# include_mask = parsed_frame[player_columns].apply(
|
| 1323 |
+
# lambda row: all(player in row.values for player in conditional_include_players), axis=1
|
| 1324 |
+
# )
|
| 1325 |
|
| 1326 |
+
# remove_mask = parsed_frame[player_columns].apply(
|
| 1327 |
+
# lambda row: not any(player in row.values for player in conditional_remove_players), axis=1
|
| 1328 |
+
# )
|
| 1329 |
|
| 1330 |
+
# parsed_frame = parsed_frame[include_mask & remove_mask]
|
| 1331 |
|
| 1332 |
+
# st.session_state['working_frame'] = parsed_frame.sort_values(by='median', ascending=False).reset_index(drop=True)
|
| 1333 |
+
# st.session_state['export_merge'] = st.session_state['working_frame'].copy()
|
| 1334 |
+
# elif exp_submitted:
|
| 1335 |
+
# st.session_state['settings_base'] = False
|
| 1336 |
+
# parsed_frame = st.session_state['export_base'].copy()
|
| 1337 |
|
| 1338 |
+
# player_columns = [col for col in parsed_frame.columns if col not in excluded_cols]
|
| 1339 |
|
| 1340 |
+
# # Test with a simpler approach
|
| 1341 |
+
# include_mask = parsed_frame[player_columns].apply(
|
| 1342 |
+
# lambda row: all(player in row.values for player in conditional_include_players), axis=1
|
| 1343 |
+
# )
|
| 1344 |
|
| 1345 |
+
# remove_mask = parsed_frame[player_columns].apply(
|
| 1346 |
+
# lambda row: not any(player in row.values for player in conditional_remove_players), axis=1
|
| 1347 |
+
# )
|
| 1348 |
|
| 1349 |
+
# parsed_frame = parsed_frame[include_mask & remove_mask]
|
| 1350 |
|
| 1351 |
+
# st.session_state['export_base'] = parsed_frame.sort_values(by='median', ascending=False).reset_index(drop=True)
|
| 1352 |
+
# st.session_state['export_merge'] = st.session_state['export_base'].copy()
|
| 1353 |
|
| 1354 |
with st.expander('Trimming Options'):
|
| 1355 |
with st.form(key='trim_form'):
|
global_func/predict_dupes.py
CHANGED
|
@@ -594,7 +594,7 @@ def predict_dupes(portfolio, maps_dict, site_var, type_var, Contest_Size, streng
|
|
| 594 |
portfolio['own_sum'] / portfolio['own_average'],
|
| 595 |
(portfolio['own_sum'] - max_ownership) / portfolio['own_average']
|
| 596 |
)
|
| 597 |
-
percentile_cut_scalar = portfolio['median'].max()
|
| 598 |
if type_var == 'Classic':
|
| 599 |
if sport_var == 'CS2':
|
| 600 |
own_ratio_nerf = 2
|
|
|
|
| 594 |
portfolio['own_sum'] / portfolio['own_average'],
|
| 595 |
(portfolio['own_sum'] - max_ownership) / portfolio['own_average']
|
| 596 |
)
|
| 597 |
+
percentile_cut_scalar = portfolio['median'].max()
|
| 598 |
if type_var == 'Classic':
|
| 599 |
if sport_var == 'CS2':
|
| 600 |
own_ratio_nerf = 2
|