Skip to content

Commit 165a235

Browse files
authored
Merge pull request #3 from ActivitySim/veh_type_optimization
Optimized Vehicle Type Model Configs
2 parents 7ddebde + b4f48ca commit 165a235

File tree

4 files changed

+189
-433
lines changed

4 files changed

+189
-433
lines changed

ext-configs/vehicle_type_choice.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,38 @@ preprocessor:
8282
- persons
8383
- households
8484

85+
alts_preprocessor:
86+
SPEC: vehicle_type_choice_annotate_alts_preprocessor
87+
DF: alts_wide
88+
89+
COLS_TO_INCLUDE_IN_CHOOSER_TABLE:
90+
- avg_hh_dist_to_work
91+
- income
92+
- hh_per_mi
93+
- auto_ownership
94+
- hh_veh_gt_drivers
95+
- total_hh_dist_to_work_cap
96+
- num_children
97+
- num_hh_veh_owned
98+
- num_hh_Van
99+
- num_hh_SUV
100+
- num_hh_Pickup
101+
- num_hh_Motorcycle
102+
- num_hh_Hybrid
103+
- num_hh_BEV
104+
- num_hh_PEV
105+
- num_hh_EV
106+
- home_is_rural
107+
108+
COLS_TO_INCLUDE_IN_ALTERNATIVES_TABLE:
109+
- age
110+
- fuel_type_num_coded
111+
- body_type_num_coded
112+
- Range
113+
- MPG
114+
- NumMakes
115+
- NumModels
116+
85117
# annotate_persons:
86118
# SPEC: annotate_persons_vehicle_type
87119
# DF: persons
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Description,Target,Expression
2+
mapping fuel type to integers,fuel_type_num_coded,"df.fuel_type.map({'BEV': 1, 'Diesel': 2, 'Gas': 3, 'Hybrid': 4, 'PEV': 5}).astype(int)"
3+
mapping body type to integers,body_type_num_coded,"df.body_type.map({'Car': 1, 'Motorcycle': 2, 'Pickup': 3, 'SUV': 4, 'Van': 5}).astype(int)"
4+
# moving log terms to preprocessor to avoid expensive log calculations,,
5+
log number of models available,logged_models,"np.log(1 + df.NumModels)"
6+
log number of makes available,logged_makes,"np.log(1 + df.NumMakes)"
7+
logged chargers per capita,logged_chargers_per_capita,"np.log(1 + CHARGERS_PER_CAP)"

0 commit comments

Comments
 (0)