-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vehicle Type Optimization #66
Changes from 3 commits
92bf60d
f1bdd88
b0061bc
a3f6056
7449923
74833cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -347,6 +347,17 @@ def iterate_vehicle_type_choice( | |
model_settings, alts_cats_dict, vehicle_type_data | ||
) | ||
|
||
# alts preprocessor | ||
alts_preprocessor_settings = model_settings.alts_preprocessor | ||
if alts_preprocessor_settings: | ||
expressions.assign_columns( | ||
state, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No state variable in this code base. This argument should be removed. |
||
df=alts_wide, | ||
model_settings=alts_preprocessor_settings, | ||
locals_dict=locals_dict, | ||
trace_label=trace_label, | ||
) | ||
|
||
# - preparing choosers for iterating | ||
vehicles_merged = vehicles_merged.to_frame() | ||
vehicles_merged["already_owned_veh"] = "" | ||
|
@@ -380,6 +391,12 @@ def iterate_vehicle_type_choice( | |
len(choosers), | ||
) | ||
|
||
# filter columns of alts and choosers | ||
if len(model_settings.get("COLS_TO_INCLUDE_IN_CHOOSER_TABLE")) > 0: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to set default for get function to be array. i.e. |
||
choosers = choosers[model_settings.get("COLS_TO_INCLUDE_IN_CHOOSER_TABLE")] | ||
if len(model_settings.get("COLS_TO_INCLUDE_IN_ALTS_TABLE")) > 0: | ||
alts_wide = alts_wide[model_settings.get("COLS_TO_INCLUDE_IN_ALTS_TABLE")] | ||
|
||
# if there were so many alts that they had to be created programmatically, | ||
# by combining categorical variables, then the utility expressions should make | ||
# use of interaction terms to accommodate alt-specific coefficients and constants | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be
model_settings.get("alts_preprocessor", None)