diff --git a/activitysim/defaults/models/school_location.py b/activitysim/defaults/models/school_location.py index c98965db3e..e3c8bc4883 100644 --- a/activitysim/defaults/models/school_location.py +++ b/activitysim/defaults/models/school_location.py @@ -48,7 +48,14 @@ def school_location_simulate(set_random_seed, choices_list.append(choices) choices = pd.concat(choices_list) - choices = choices.reindex(persons_merged.index) + + # this fillna is necessary to avoid a downstream crash and might be a bit + # wrong logically. The issue here is that there is a small but non-zero + # chance to choose a school trip even if not of the school type (because + # of -999 rather than outright removal of alternative availability). - + # this fills in the location for those uncommon circumstances, + # so at least it runs + choices = choices.reindex(persons_merged.index).fillna(-1) print "Describe of choices:\n", choices.describe() sim.add_column("persons", "school_taz", choices) diff --git a/example/configs/settings.yaml b/example/configs/settings.yaml index 86498dbf79..6250ec8e54 100644 --- a/example/configs/settings.yaml +++ b/example/configs/settings.yaml @@ -5,7 +5,7 @@ urban_threshold: 4 cbd_threshold: 2 rural_threshold: 6 -households_sample_size: 1000 +households_sample_size: 100 grade_school_max_age: 14 diff --git a/example/simulation.ipynb b/example/simulation.ipynb index 92407439ea..01b78ca7e4 100644 --- a/example/simulation.ipynb +++ b/example/simulation.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:297e31f6b2b6fcfa9c3e555719a1dd618a184aea8a5231f4cce01c6fa94f72d2" + "signature": "sha256:7a8230b2c21bf7bd8085ec73ad6088bb2a4d40b26c5312fa01c6f8c62bd4ac7c" }, "nbformat": 3, "nbformat_minor": 0, @@ -22,6 +22,30 @@ "outputs": [], "prompt_number": 1 }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Run this cell to use the test data which comes with the repo" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import pandas as pd\n", + "import numpy as np\n", + "import os\n", + "sim.add_injectable(\"store\", pd.HDFStore(\n", + " os.path.join(\"..\", \"activitysim\", \"defaults\", \"test\", \"test.h5\"), \"r\"))\n", + "sim.add_injectable(\"nonmotskm_matrix\", np.ones((1454, 1454)))" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 3 + }, { "cell_type": "code", "collapsed": false, @@ -43,7 +67,9 @@ "output_type": "stream", "stream": "stdout", "text": [ - "['mode_choice_logsums']\n", + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\" 'mode_choice_logsums']\n", "WARNING: Some columns have no variability:\n" ] }, @@ -51,7 +77,9 @@ "output_type": "stream", "stream": "stdout", "text": [ - "['mode_choice_logsums']\n", + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\" 'mode_choice_logsums']\n", "WARNING: Some columns have no variability:\n" ] }, @@ -59,29 +87,25 @@ "output_type": "stream", "stream": "stdout", "text": [ - "['mode_choice_logsums']\n", - "Describe of choices:\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "count 2537.000000\n", - "mean 197.994876\n", - "std 395.213046\n", + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\" 'mode_choice_logsums']\n", + "Describe of choices:\n", + "count 267.000000\n", + "mean 205.059925\n", + "std 383.520970\n", "min -1.000000\n", "25% -1.000000\n", "50% -1.000000\n", - "75% 117.000000\n", - "max 1450.000000\n", + "75% 260.500000\n", + "max 1424.000000\n", "Name: TAZ, dtype: float64\n", - "Time to execute model 'school_location_simulate': 21.20s\n", - "Total time to execute: 21.20s\n" + "Time to execute model 'school_location_simulate': 0.98s\n", + "Total time to execute: 0.98s\n" ] } ], - "prompt_number": 2 + "prompt_number": 4 }, { "cell_type": "code", @@ -104,7 +128,11 @@ "output_type": "stream", "stream": "stdout", "text": [ - "['mode_choice_logsums']\n", + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\"\n", + " \"@(df.income_segment>=3)*(skims['DISTANCE']-5).clip(0)\"\n", + " 'mode_choice_logsums']\n", "Describe of choices:\n" ] }, @@ -112,21 +140,21 @@ "output_type": "stream", "stream": "stdout", "text": [ - "count 2537.000000\n", - "mean 330.899488\n", - "std 463.456484\n", - "min -1.000000\n", - "25% -1.000000\n", - "50% -1.000000\n", - "75% 665.000000\n", - "max 1452.000000\n", + "count 267.000000\n", + "mean 653.340824\n", + "std 450.452880\n", + "min 1.000000\n", + "25% 310.000000\n", + "50% 563.000000\n", + "75% 1046.500000\n", + "max 1450.000000\n", "Name: TAZ, dtype: float64\n", - "Time to execute model 'workplace_location_simulate': 11.85s\n", - "Total time to execute: 11.85s\n" + "Time to execute model 'workplace_location_simulate': 2.10s\n", + "Total time to execute: 2.10s\n" ] } ], - "prompt_number": 3 + "prompt_number": 5 }, { "cell_type": "code", @@ -141,19 +169,19 @@ "output_type": "stream", "stream": "stdout", "text": [ - "count 2537.000000\n", - "mean 24.922901\n", - "std 27.613780\n", - "min 0.290000\n", - "25% 2.060000\n", - "50% 14.760000\n", - "75% 44.440000\n", - "max 135.050000\n", + "count 267\n", + "mean 1\n", + "std 0\n", + "min 1\n", + "25% 1\n", + "50% 1\n", + "75% 1\n", + "max 1\n", "dtype: float64\n" ] } ], - "prompt_number": 4 + "prompt_number": 6 }, { "cell_type": "code", @@ -177,25 +205,19 @@ "stream": "stdout", "text": [ "['@1' 'work_tour_auto_time_savings / (workers+1)']\n", - "Choices:\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "2 407\n", - "1 315\n", - "3 150\n", - "0 93\n", - "4 35\n", + "Choices:\n", + "2 47\n", + "1 28\n", + "3 12\n", + "0 10\n", + "4 3\n", "dtype: int64\n", - "Time to execute model 'auto_ownership_simulate': 0.36s\n", - "Total time to execute: 0.36s\n" + "Time to execute model 'auto_ownership_simulate': 0.23s\n", + "Total time to execute: 0.23s\n" ] } ], - "prompt_number": 5 + "prompt_number": 7 }, { "cell_type": "code", @@ -218,16 +240,16 @@ "output_type": "stream", "stream": "stdout", "text": [ - "Home 980\n", - "NonMandatory 791\n", - "Mandatory 766\n", + "Home 103\n", + "NonMandatory 84\n", + "Mandatory 80\n", "dtype: int64\n", - "Time to execute model 'cdap_simulate': 79.05s\n", - "Total time to execute: 79.05s\n" + "Time to execute model 'cdap_simulate': 3.89s\n", + "Total time to execute: 3.89s\n" ] } ], - "prompt_number": 6 + "prompt_number": 8 }, { "cell_type": "code", @@ -243,7 +265,7 @@ "stream": "stdout", "text": [ "Running model 'mandatory_tour_frequency'\n", - "766 persons run for mandatory tour model" + "80 persons run for mandatory tour model" ] }, { @@ -251,6 +273,15 @@ "stream": "stdout", "text": [ "\n", + "count 80.000000\n", + "mean 589.800000\n", + "std 449.608617\n", + "min 1.000000\n", + "25% 238.750000\n", + "50% 507.500000\n", + "75% 969.250000\n", + "max 1448.000000\n", + "Name: workplace_taz, dtype: float64\n", "WARNING: Some columns have no variability:\n" ] }, @@ -258,30 +289,28 @@ "output_type": "stream", "stream": "stdout", "text": [ - "['(ptype == 4) & (distance_to_work < 3)'\n", - " '(ptype == 5) & (distance_to_work < 3)'\n", + "['(ptype == 1) & nonstudent_to_school'\n", " '(ptype == 2) & nonstudent_to_school'\n", " '(ptype == 4) & nonstudent_to_school'\n", - " '(ptype == 5) & nonstudent_to_school' '(ptype == 7) & non_family']\n", - "Choices:\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "work1 542\n", - "school1 169\n", - "work2 32\n", - "school2 12\n", - "work_and_school 11\n", + " '(ptype == 5) & nonstudent_to_school'\n", + " '(ptype == 5) & (auto_ownership == 0)'\n", + " '(ptype == 6) & (auto_ownership == 0)'\n", + " '(ptype == 2) * (num_young_children)'\n", + " '(ptype == 5) * (num_young_children)' '(ptype == 6) & non_family'\n", + " '(ptype == 7) & non_family' '(ptype == 6) & home_is_urban'\n", + " '~(workplace_taz > -1)']\n", + "Choices:\n", + "work1 41\n", + "work2 28\n", + "school1 9\n", + "work_and_school 2\n", "dtype: int64\n", - "Time to execute model 'mandatory_tour_frequency': 2.58s\n", - "Total time to execute: 2.58s\n" + "Time to execute model 'mandatory_tour_frequency': 0.87s\n", + "Total time to execute: 0.87s\n" ] } ], - "prompt_number": 10 + "prompt_number": 9 }, { "cell_type": "code", @@ -295,15 +324,15 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 11, + "prompt_number": 10, "text": [ - "work 617\n", - "school 204\n", + "work 99\n", + "school 11\n", "dtype: int64" ] } ], - "prompt_number": 11 + "prompt_number": 10 }, { "cell_type": "code", @@ -319,7 +348,7 @@ "stream": "stdout", "text": [ "Running model 'mandatory_scheduling'\n", - "Running 821 mandatory tour scheduling choices" + "Running 11 school tour scheduling choices" ] }, { @@ -327,7 +356,7 @@ "stream": "stdout", "text": [ "\n", - "Running 766 #1 tour choices\n", + "Running 11 #1 tour choices\n", "WARNING: Some columns have no variability:\n" ] }, @@ -335,49 +364,56 @@ "output_type": "stream", "stream": "stdout", "text": [ - "['(start <= end_previous) & (tour_num == 2)' '(tour_num == 2) * start'\n", - " '(tour_num == 2) * duration' 'home_is_rural & (start < 6)'\n", - " 'home_is_rural & (end > 22)' '(tour_num == 2) & (duration < 8)']\n", - "Running 55 #2 tour choices" + "['(ptype == 4) * start' '(tour_num > 1) & (start < end_previous)']\n", + "Running 99 work tour scheduling choices\n", + "Running 71 #1 tour choices\n", + "WARNING: Some columns have no variability:\n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ - "\n", - "WARNING: Some columns have no variability:\n" + "['home_is_rural & (start < 6)' 'home_is_rural & (end > 22)']\n", + "Running 28 #2 tour choices" ] }, { "output_type": "stream", "stream": "stdout", "text": [ - "['(ptype == 4) * duration' '(tour_num == 1) * start'\n", - " '(tour_num == 1) * duration' 'home_is_rural & (start < 6)'\n", - " 'home_is_rural & (end > 22)' '(tour_num == 1) & (duration < 8)']\n", - "Choices:\n" + "\n", + "WARNING: Some columns have no variability:\n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ - "count 821.000000\n", - "mean 169.792935\n", - "std 45.827018\n", + "['(ptype == 2) * start' '(ptype == 3) * start' '(tour_num == 1) * start'\n", + " '(tour_num == 1) * duration' 'home_is_rural & (start < 6)'\n", + " 'home_is_rural & (end > 22)' '(ptype == 1) & (duration < 9)'\n", + " '(ptype == 1) & (start > 9) & (start < 13)'\n", + " '(ptype == 2) & (end > 12) & (end < 16)'\n", + " '(tour_num == 1) & (duration < 8)'\n", + " \"(mandatory_tour_frequency == 'work_and_school') & is_worker & (duration < 8)\"\n", + " \"(mandatory_tour_frequency == 'work_and_school') & is_student & (duration < 8)\"]\n", + "Choices:\n", + "count 110.000000\n", + "mean 156.118182\n", + "std 66.378776\n", "min 0.000000\n", - "25% 181.000000\n", + "25% 176.000000\n", "50% 187.000000\n", "75% 188.000000\n", "max 189.000000\n", "dtype: float64\n", - "Time to execute model 'mandatory_scheduling': 5.90s\n", - "Total time to execute: 5.90s\n" + "Time to execute model 'mandatory_scheduling': 1.48s\n", + "Total time to execute: 1.48s\n" ] } ], - "prompt_number": 12 + "prompt_number": 11 }, { "cell_type": "code", @@ -393,7 +429,7 @@ "stream": "stdout", "text": [ "Running model 'non_mandatory_tour_frequency'\n", - "1557 persons run for non-mandatory tour model" + "164 persons run for non-mandatory tour model" ] }, { @@ -401,7 +437,7 @@ "stream": "stdout", "text": [ "\n", - "Running segment 'driving' of size 42\n", + "Running segment 'driving' of size 4\n", "WARNING: Some columns have no variability:\n" ] }, @@ -416,24 +452,36 @@ " 'max_window*(tot_tours == 0)' 'max_window*(tot_tours == 1)'\n", " 'max_window*(tot_tours == 2)' 'max_window*(tot_tours == 3)'\n", " 'max_window*(tot_tours == 4)' 'max_window*(tot_tours > 4)'\n", + " '(100 < income_in_thousands) & (tot_tours == 1)'\n", + " '(100 < income_in_thousands) & (tot_tours == 2)'\n", + " '(100 < income_in_thousands) & (tot_tours == 3)'\n", + " '(100 < income_in_thousands) & (tot_tours == 4)'\n", + " '(100 < income_in_thousands) & (tot_tours > 4)'\n", + " '(100 < income_in_thousands) * shopping'\n", + " '(100 < income_in_thousands) * othmaint'\n", + " '(100 < income_in_thousands) * eatout'\n", + " '(100 < income_in_thousands) * othdiscr'\n", + " '(100 < income_in_thousands) * social' 'no_cars & (tot_tours == 1)'\n", + " 'no_cars & (tot_tours == 2)' 'no_cars & (tot_tours == 3)'\n", + " 'no_cars & (tot_tours == 4)' 'no_cars & (tot_tours > 4)'\n", " '(car_sufficiency > 0) & (tot_tours == 1)'\n", " '(car_sufficiency > 0) & (tot_tours == 2)'\n", " '(car_sufficiency > 0) & (tot_tours == 3)'\n", " '(car_sufficiency > 0) & (tot_tours == 4)'\n", - " '(car_sufficiency > 0) & (tot_tours > 4)'\n", + " '(car_sufficiency > 0) & (tot_tours > 4)' 'has_part_time * escort'\n", " 'has_school_kid_at_home * escort' 'has_preschool_kid_at_home * escort'\n", - " 'has_school_kid_at_home * shopping' 'has_preschool_kid_at_home * shopping'\n", + " 'has_part_time * shopping' 'has_school_kid_at_home * shopping'\n", + " 'has_preschool_kid_at_home * shopping' 'has_part_time * othmaint'\n", " 'has_school_kid_at_home * othmaint' 'has_preschool_kid_at_home * othmaint'\n", - " 'has_school_kid_at_home * eatout' 'has_preschool_kid_at_home * eatout'\n", - " 'has_school_kid_at_home * othdiscr' 'has_preschool_kid_at_home * othdiscr']\n", - "Running segment 'full' of size 543" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", + " 'has_part_time * eatout' 'has_school_kid_at_home * eatout'\n", + " 'has_preschool_kid_at_home * eatout' 'has_part_time * othdiscr'\n", + " 'has_school_kid_at_home * othdiscr' 'has_preschool_kid_at_home * othdiscr'\n", + " 'home_is_urban & (tot_tours == 1)' 'home_is_urban & (tot_tours == 2)'\n", + " 'home_is_urban & (tot_tours == 3)' 'home_is_urban & (tot_tours == 4)'\n", + " 'home_is_urban & (tot_tours > 4)' 'home_is_urban * escort'\n", + " 'home_is_urban * shopping' 'home_is_urban * othmaint'\n", + " 'home_is_urban * eatout' 'home_is_urban * othdiscr' 'escort * no_cars']\n", + "Running segment 'full' of size 46\n", "WARNING: Some columns have no variability:\n" ] }, @@ -453,7 +501,7 @@ " 'has_school_kid_at_home * othmaint' 'has_preschool_kid_at_home * othmaint'\n", " 'has_school_kid_at_home * eatout' 'has_preschool_kid_at_home * eatout'\n", " 'has_school_kid_at_home * othdiscr' 'has_preschool_kid_at_home * othdiscr']\n", - "Running segment 'nonwork' of size 279" + "Running segment 'nonwork' of size 38" ] }, { @@ -480,7 +528,7 @@ " 'has_school_kid_at_home * othmaint' 'has_preschool_kid_at_home * othmaint'\n", " 'has_school_kid_at_home * eatout' 'has_preschool_kid_at_home * eatout'\n", " 'has_school_kid_at_home * othdiscr' 'has_preschool_kid_at_home * othdiscr']\n", - "Running segment 'part' of size 129" + "Running segment 'part' of size 12" ] }, { @@ -502,19 +550,20 @@ " 'max_window*(tot_tours == 0)' 'max_window*(tot_tours == 1)'\n", " 'max_window*(tot_tours == 2)' 'max_window*(tot_tours == 3)'\n", " 'max_window*(tot_tours == 4)' 'max_window*(tot_tours > 4)'\n", - " 'has_school_kid_at_home * escort' 'has_preschool_kid_at_home * escort'\n", + " 'has_part_time * escort' 'has_university * escort'\n", + " 'has_driving_kid * escort' 'has_school_kid_at_home * escort'\n", + " 'has_preschool_kid_at_home * escort' 'has_part_time * shopping'\n", + " 'has_university * shopping' 'has_driving_kid * shopping'\n", " 'has_school_kid_at_home * shopping' 'has_preschool_kid_at_home * shopping'\n", - " 'has_school_kid_at_home * othmaint' 'has_preschool_kid_at_home * othmaint'\n", + " 'has_part_time * othmaint' 'has_university * othmaint'\n", + " 'has_driving_kid * othmaint' 'has_school_kid_at_home * othmaint'\n", + " 'has_preschool_kid_at_home * othmaint' 'has_part_time * eatout'\n", + " 'has_university * eatout' 'has_driving_kid * eatout'\n", " 'has_school_kid_at_home * eatout' 'has_preschool_kid_at_home * eatout'\n", - " 'has_school_kid_at_home * othdiscr' 'has_preschool_kid_at_home * othdiscr']\n", - "Running segment 'preschool' of size 115" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", + " 'has_part_time * othdiscr' 'has_university * othdiscr'\n", + " 'has_driving_kid * othdiscr' 'has_school_kid_at_home * othdiscr'\n", + " 'has_preschool_kid_at_home * othdiscr']\n", + "Running segment 'preschool' of size 15\n", "WARNING: Some columns have no variability:\n" ] }, @@ -533,20 +582,23 @@ " '(car_sufficiency > 0) & (tot_tours == 2)'\n", " '(car_sufficiency > 0) & (tot_tours == 3)'\n", " '(car_sufficiency > 0) & (tot_tours == 4)'\n", - " '(car_sufficiency > 0) & (tot_tours > 4)'\n", - " 'has_school_kid_at_home * escort' 'has_preschool_kid_at_home * escort'\n", - " 'has_school_kid_at_home * shopping' 'has_preschool_kid_at_home * shopping'\n", - " 'has_school_kid_at_home * othmaint' 'has_preschool_kid_at_home * othmaint'\n", - " 'has_school_kid_at_home * eatout' 'has_preschool_kid_at_home * eatout'\n", - " 'has_school_kid_at_home * othdiscr' 'has_preschool_kid_at_home * othdiscr']\n", - "Running segment 'retired' of size 180" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", + " '(car_sufficiency > 0) & (tot_tours > 4)' 'has_university * escort'\n", + " 'has_driving_kid * escort' 'has_school_kid_at_home * escort'\n", + " 'has_preschool_kid_at_home * escort' 'has_university * shopping'\n", + " 'has_driving_kid * shopping' 'has_school_kid_at_home * shopping'\n", + " 'has_preschool_kid_at_home * shopping' 'has_university * othmaint'\n", + " 'has_driving_kid * othmaint' 'has_school_kid_at_home * othmaint'\n", + " 'has_preschool_kid_at_home * othmaint' 'has_university * eatout'\n", + " 'has_driving_kid * eatout' 'has_school_kid_at_home * eatout'\n", + " 'has_preschool_kid_at_home * eatout' 'has_university * othdiscr'\n", + " 'has_driving_kid * othdiscr' 'has_school_kid_at_home * othdiscr'\n", + " 'has_preschool_kid_at_home * othdiscr' 'home_is_urban & (tot_tours == 1)'\n", + " 'home_is_urban & (tot_tours == 2)' 'home_is_urban & (tot_tours == 3)'\n", + " 'home_is_urban & (tot_tours == 4)' 'home_is_urban & (tot_tours > 4)'\n", + " 'home_is_urban * escort' 'home_is_urban * shopping'\n", + " 'home_is_urban * othmaint' 'home_is_urban * eatout'\n", + " 'home_is_urban * othdiscr']\n", + "Running segment 'retired' of size 20\n", "WARNING: Some columns have no variability:\n" ] }, @@ -561,19 +613,15 @@ " 'max_window*(tot_tours == 0)' 'max_window*(tot_tours == 1)'\n", " 'max_window*(tot_tours == 2)' 'max_window*(tot_tours == 3)'\n", " 'max_window*(tot_tours == 4)' 'max_window*(tot_tours > 4)'\n", - " 'has_school_kid_at_home * escort' 'has_preschool_kid_at_home * escort'\n", - " 'has_school_kid_at_home * shopping' 'has_preschool_kid_at_home * shopping'\n", - " 'has_school_kid_at_home * othmaint' 'has_preschool_kid_at_home * othmaint'\n", - " 'has_school_kid_at_home * eatout' 'has_preschool_kid_at_home * eatout'\n", - " 'has_school_kid_at_home * othdiscr' 'has_preschool_kid_at_home * othdiscr']\n", - "Running segment 'school' of size 197" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", + " 'no_cars & (tot_tours == 1)' 'no_cars & (tot_tours == 2)'\n", + " 'no_cars & (tot_tours == 3)' 'no_cars & (tot_tours == 4)'\n", + " 'no_cars & (tot_tours > 4)' 'has_school_kid_at_home * escort'\n", + " 'has_preschool_kid_at_home * escort' 'has_school_kid_at_home * shopping'\n", + " 'has_preschool_kid_at_home * shopping' 'has_school_kid_at_home * othmaint'\n", + " 'has_preschool_kid_at_home * othmaint' 'has_school_kid_at_home * eatout'\n", + " 'has_preschool_kid_at_home * eatout' 'has_school_kid_at_home * othdiscr'\n", + " 'has_preschool_kid_at_home * othdiscr' 'escort * no_cars']\n", + "Running segment 'school' of size 21\n", "WARNING: Some columns have no variability:\n" ] }, @@ -588,12 +636,19 @@ " 'max_window*(tot_tours == 0)' 'max_window*(tot_tours == 1)'\n", " 'max_window*(tot_tours == 2)' 'max_window*(tot_tours == 3)'\n", " 'max_window*(tot_tours == 4)' 'max_window*(tot_tours > 4)'\n", + " '(car_sufficiency > 0) & (tot_tours == 1)'\n", + " '(car_sufficiency > 0) & (tot_tours == 2)'\n", + " '(car_sufficiency > 0) & (tot_tours == 3)'\n", + " '(car_sufficiency > 0) & (tot_tours == 4)'\n", + " '(car_sufficiency > 0) & (tot_tours > 4)' 'has_university * escort'\n", " 'has_school_kid_at_home * escort' 'has_preschool_kid_at_home * escort'\n", - " 'has_school_kid_at_home * shopping' 'has_preschool_kid_at_home * shopping'\n", + " 'has_university * shopping' 'has_school_kid_at_home * shopping'\n", + " 'has_preschool_kid_at_home * shopping' 'has_university * othmaint'\n", " 'has_school_kid_at_home * othmaint' 'has_preschool_kid_at_home * othmaint'\n", - " 'has_school_kid_at_home * eatout' 'has_preschool_kid_at_home * eatout'\n", + " 'has_university * eatout' 'has_school_kid_at_home * eatout'\n", + " 'has_preschool_kid_at_home * eatout' 'has_university * othdiscr'\n", " 'has_school_kid_at_home * othdiscr' 'has_preschool_kid_at_home * othdiscr']\n", - "Running segment 'university' of size 72" + "Running segment 'university' of size 8" ] }, { @@ -615,80 +670,51 @@ " 'max_window*(tot_tours == 0)' 'max_window*(tot_tours == 1)'\n", " 'max_window*(tot_tours == 2)' 'max_window*(tot_tours == 3)'\n", " 'max_window*(tot_tours == 4)' 'max_window*(tot_tours > 4)'\n", - " '(car_sufficiency > 0) & (tot_tours == 1)'\n", - " '(car_sufficiency > 0) & (tot_tours == 2)'\n", - " '(car_sufficiency > 0) & (tot_tours == 3)'\n", - " '(car_sufficiency > 0) & (tot_tours == 4)'\n", - " '(car_sufficiency > 0) & (tot_tours > 4)'\n", + " 'has_school_kid & (tot_tours == 1)' 'has_school_kid & (tot_tours == 2)'\n", + " 'has_school_kid & (tot_tours == 3)' 'has_school_kid & (tot_tours == 4)'\n", + " 'has_school_kid & (tot_tours == 5)' 'has_part_time * escort'\n", + " 'has_driving_kid * escort' 'has_school_kid * escort'\n", " 'has_school_kid_at_home * escort' 'has_preschool_kid_at_home * escort'\n", - " 'has_school_kid_at_home * shopping' 'has_preschool_kid_at_home * shopping'\n", + " 'has_part_time * shopping' 'has_driving_kid * shopping'\n", + " 'has_school_kid * shopping' 'has_school_kid_at_home * shopping'\n", + " 'has_preschool_kid_at_home * shopping' 'has_part_time * othmaint'\n", + " 'has_driving_kid * othmaint' 'has_school_kid * othmaint'\n", " 'has_school_kid_at_home * othmaint' 'has_preschool_kid_at_home * othmaint'\n", - " 'has_school_kid_at_home * eatout' 'has_preschool_kid_at_home * eatout'\n", + " 'has_part_time * eatout' 'has_driving_kid * eatout'\n", + " 'has_school_kid * eatout' 'has_school_kid_at_home * eatout'\n", + " 'has_preschool_kid_at_home * eatout' 'has_part_time * othdiscr'\n", + " 'has_driving_kid * othdiscr' 'has_school_kid * othdiscr'\n", " 'has_school_kid_at_home * othdiscr' 'has_preschool_kid_at_home * othdiscr']\n", - "Choices:\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "0 761\n", - "16 179\n", - "1 131\n", - "8 95\n", - "32 76\n", - "4 65\n", - "2 47\n", - "64 25\n", - "17 23\n", - "24 18\n", - "20 11\n", - "5 11\n", - "40 10\n", - "9 9\n", - "36 8\n", - "33 8\n", - "80 7\n", - "48 7\n", - "12 5\n", - "10 5\n", - "49 4\n", - "6 4\n", - "18 4\n", - "3 3\n", - "65 3\n", - "21 3\n", - "44 3\n", - "34 3\n", - "41 2\n", - "25 2\n", - "72 2\n", - "57 2\n", - "52 2\n", - "13 2\n", - "66 2\n", - "7 1\n", - "74 1\n", - "11 1\n", - "67 1\n", - "69 1\n", - "22 1\n", - "29 1\n", - "76 1\n", - "35 1\n", - "37 1\n", - "51 1\n", - "53 1\n", - "56 1\n", - "60 1\n", - "26 1\n", + "Choices:\n", + "0 79\n", + "16 21\n", + "1 15\n", + "4 10\n", + "8 10\n", + "32 7\n", + "2 5\n", + "48 2\n", + "17 2\n", + "20 1\n", + "5 1\n", + "10 1\n", + "88 1\n", + "84 1\n", + "33 1\n", + "34 1\n", + "40 1\n", + "64 1\n", + "65 1\n", + "68 1\n", + "80 1\n", + "26 1\n", "dtype: int64\n", - "Time to execute model 'non_mandatory_tour_frequency': 16.53s\n", - "Total time to execute: 16.53s\n" + "Time to execute model 'non_mandatory_tour_frequency': 8.13s\n", + "Total time to execute: 8.13s\n" ] } ], - "prompt_number": 13 + "prompt_number": 12 }, { "cell_type": "code", @@ -702,19 +728,19 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 14, - "text": [ - "shopping 269\n", - "escort 217\n", - "othdiscr 212\n", - "othmaint 162\n", - "eatout 122\n", - "social 76\n", + "prompt_number": 13, + "text": [ + "shopping 30\n", + "escort 24\n", + "othdiscr 20\n", + "eatout 14\n", + "othmaint 14\n", + "social 8\n", "dtype: int64" ] } ], - "prompt_number": 14 + "prompt_number": 13 }, { "cell_type": "code", @@ -730,7 +756,7 @@ "stream": "stdout", "text": [ "Running model 'destination_choice'\n", - "Running segment 'eatout' of size 122" + "Index([u'university', u'highschool', u'gradeschool', u'escortkids', u'escortnokids', u'shopping', u'eatout', u'othmaint', u'social', u'othdiscr', u'workbased'], dtype='object')" ] }, { @@ -738,60 +764,99 @@ "stream": "stdout", "text": [ "\n", - "Running segment 'othdiscr' of size 212" + "eatout\n", + "Running segment 'eatout' of size 14\n", + "WARNING: Some columns have no variability:\n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ - "\n", - "Running segment 'othmaint' of size 162" + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\"]\n", + "Index([u'university', u'highschool', u'gradeschool', u'escortkids', u'escortnokids', u'shopping', u'eatout', u'othmaint', u'social', u'othdiscr', u'workbased'], dtype='object')\n", + "shopping\n", + "Running segment 'shopping' of size 24\n", + "WARNING: Some columns have no variability:\n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ - "\n", - "Running segment 'shopping' of size 269" + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\"]\n", + "Index([u'university', u'highschool', u'gradeschool', u'escortkids', u'escortnokids', u'shopping', u'eatout', u'othmaint', u'social', u'othdiscr', u'workbased'], dtype='object')\n", + "othdiscr\n", + "Running segment 'othdiscr' of size 20\n", + "WARNING: Some columns have no variability:\n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ - "\n", - "Running segment 'social' of size 76" + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\"]\n", + "Index([u'university', u'highschool', u'gradeschool', u'escortkids', u'escortnokids', u'shopping', u'eatout', u'othmaint', u'social', u'othdiscr', u'workbased'], dtype='object')\n", + "othmaint\n", + "Running segment 'othmaint' of size 14\n", + "WARNING: Some columns have no variability:\n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ - "\n", - "Choices:\n" + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\"]\n", + "Index([u'university', u'highschool', u'gradeschool', u'escortkids', u'escortnokids', u'shopping', u'eatout', u'othmaint', u'social', u'othdiscr', u'workbased'], dtype='object')\n", + "shopping\n", + "Running segment 'shopping' of size 30\n", + "WARNING: Some columns have no variability:\n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ - "count 841.000000\n", - "mean 728.715815\n", - "std 419.654156\n", + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\"]\n", + "Index([u'university', u'highschool', u'gradeschool', u'escortkids', u'escortnokids', u'shopping', u'eatout', u'othmaint', u'social', u'othdiscr', u'workbased'], dtype='object')\n", + "social\n", + "Running segment 'social' of size 8\n", + "WARNING: Some columns have no variability:\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "[\"@skims['DISTANCE'].clip(1)\" \"@(skims['DISTANCE']-1).clip(0,1)\"\n", + " \"@(skims['DISTANCE']-2).clip(0,3)\" \"@(skims['DISTANCE']-5).clip(0,10)\"\n", + " \"@(skims['DISTANCE']-15.0).clip(0)\"]\n", + "Choices:\n", + "count 110.000000\n", + "mean 736.836364\n", + "std 466.741142\n", "min 2.000000\n", - "25% 400.000000\n", - "50% 733.000000\n", - "75% 1122.000000\n", - "max 1450.000000\n", + "25% 373.500000\n", + "50% 688.500000\n", + "75% 1164.000000\n", + "max 1448.000000\n", "Name: TAZ, dtype: float64\n", - "Time to execute model 'destination_choice': 7.73s\n", - "Total time to execute: 7.73s\n" + "Time to execute model 'destination_choice': 1.83s\n", + "Total time to execute: 1.83s\n" ] } ], - "prompt_number": 15 + "prompt_number": 14 }, { "cell_type": "code", @@ -807,7 +872,7 @@ "stream": "stdout", "text": [ "Running model 'non_mandatory_scheduling'\n", - "Running 1058 non-mandatory tour scheduling choices" + "Running 110 non-mandatory tour scheduling choices" ] }, { @@ -815,7 +880,7 @@ "stream": "stdout", "text": [ "\n", - "Running 796 #1 tour choices\n", + "Running 85 #1 tour choices\n", "WARNING: Some columns have no variability:\n" ] }, @@ -823,8 +888,12 @@ "output_type": "stream", "stream": "stdout", "text": [ - "['(tour_type == \"oth_maint\") * start']\n", - "Running 203 #2 tour choices" + "['(start <= end_previous) & (tour_num > 1)'\n", + " '(tour_type == \"oth_maint\") * start'\n", + " '(tour_type == \"oth_maint\") * duration' 'num_joint_tours * start'\n", + " '(tour_num > 1) * duration' '(tour_type == \"oth_maint\") & (start < 7)'\n", + " '(tour_type == \"othdisc\") & (duration < 2)']\n", + "Running 17 #2 tour choices" ] }, { @@ -839,8 +908,12 @@ "output_type": "stream", "stream": "stdout", "text": [ - "['(tour_type == \"oth_maint\") * start']\n", - "Running 49 #3 tour choices\n", + "['(tour_type == \"oth_maint\") * start'\n", + " '(tour_type == \"oth_maint\") * duration' '(ptype == 7) * start'\n", + " '(ptype == 7) * duration' 'num_mand * start' 'num_joint_tours * start'\n", + " '(tour_num == 1) * start' '(tour_type == \"oth_maint\") & (start < 7)'\n", + " '(ptype == 7) & (end > 22)' '(tour_type == \"othdisc\") & (duration < 2)']\n", + "Running 6 #3 tour choices\n", "WARNING: Some columns have no variability:\n" ] }, @@ -848,8 +921,40 @@ "output_type": "stream", "stream": "stdout", "text": [ - "['(tour_type == \"oth_maint\") * start']\n", - "Running 10 #4 tour choices\n", + "['(tour_type == \"oth_maint\") * start'\n", + " '(tour_type == \"oth_maint\") * duration' '(ptype == 7) * start'\n", + " '(ptype == 7) * duration' 'num_mand * start' 'num_joint_tours * start'\n", + " '(tour_num == 1) * start' '(tour_type == \"oth_maint\") & (start < 7)'\n", + " '(ptype == 7) & (end > 22)' '(ptype == 3) & (end > 22)'\n", + " '(tour_type == \"othdisc\") & (duration < 2)'\n", + " '(tour_type == \"escort\") & (start < 6)'\n", + " '(tour_type == \"escort\") & (start == 6)'\n", + " '(tour_type == \"escort\") & (start == 7)'\n", + " '(tour_type == \"escort\") & (start == 8)'\n", + " '(tour_type == \"escort\") & (start == 9)'\n", + " '(tour_type == \"escort\") & (start > 9) & (start < 13)'\n", + " '(tour_type == \"escort\") & (start > 12) & (start < 16)'\n", + " '(tour_type == \"escort\") & (start > 15) & (start < 19)'\n", + " '(tour_type == \"escort\") & (start > 18) & (start < 22)'\n", + " '(tour_type == \"escort\") & (start > 21)'\n", + " '(tour_type == \"escort\") & (end < 7)'\n", + " '(tour_type == \"escort\") & (end > 6) & (end < 10)'\n", + " '(tour_type == \"escort\") & (end > 9) & (end < 13)'\n", + " '(tour_type == \"escort\") & (end > 12) & (end < 15)'\n", + " '(tour_type == \"escort\") & (end == 15)'\n", + " '(tour_type == \"escort\") & (end == 16)'\n", + " '(tour_type == \"escort\") & (end == 17)'\n", + " '(tour_type == \"escort\") & (end == 18)'\n", + " '(tour_type == \"escort\") & (end > 18) & (end < 22)'\n", + " '(tour_type == \"escort\") & (end > 21)'\n", + " '(tour_type == \"escort\") & (duration < 2)'\n", + " '(tour_type == \"escort\") & (duration > 1) & (duration < 4)'\n", + " '(tour_type == \"escort\") & (duration > 3) & (duration < 6)'\n", + " '(tour_type == \"escort\") & (duration > 5) & (duration < 8)'\n", + " '(tour_type == \"escort\") & (duration > 7) & (duration < 11)'\n", + " '(tour_type == \"escort\") & (duration > 10) & (duration < 14)'\n", + " '(tour_type == \"escort\") & (duration > 13) & (duration < 19)']\n", + "Running 2 #4 tour choices\n", "WARNING: Some columns have no variability:\n" ] }, @@ -858,23 +963,60 @@ "stream": "stdout", "text": [ "['(tour_type == \"shopping\") * start' '(tour_type == \"shopping\") * duration'\n", - " '(tour_type == \"oth_maint\") * start']\n", + " '(tour_type == \"oth_maint\") * start'\n", + " '(tour_type == \"oth_maint\") * duration' '(tour_type == \"social\") * start'\n", + " '(tour_type == \"social\") * duration' '(ptype == 6) * start'\n", + " '(ptype == 6) * duration' '(ptype == 7) * start' '(ptype == 7) * duration'\n", + " 'destination_in_cbd * duration' 'num_mand * start'\n", + " 'num_joint_tours * start' '(tour_num == 1) * start'\n", + " '(tour_type == \"oth_maint\") & (start < 7)'\n", + " '(tour_type == \"shopping\") & (start < 8)'\n", + " '(tour_type == \"shopping\") & (end > 22)' '(ptype == 7) & (end > 22)'\n", + " '(ptype == 3) & (end > 22)' '(tour_type == \"shopping\") & (duration < 2)'\n", + " '(tour_type == \"othdisc\") & (duration < 2)'\n", + " '(tour_type == \"escort\") & (start < 6)'\n", + " '(tour_type == \"escort\") & (start == 6)'\n", + " '(tour_type == \"escort\") & (start == 7)'\n", + " '(tour_type == \"escort\") & (start == 8)'\n", + " '(tour_type == \"escort\") & (start == 9)'\n", + " '(tour_type == \"escort\") & (start > 9) & (start < 13)'\n", + " '(tour_type == \"escort\") & (start > 12) & (start < 16)'\n", + " '(tour_type == \"escort\") & (start > 15) & (start < 19)'\n", + " '(tour_type == \"escort\") & (start > 18) & (start < 22)'\n", + " '(tour_type == \"escort\") & (start > 21)'\n", + " '(tour_type == \"escort\") & (end < 7)'\n", + " '(tour_type == \"escort\") & (end > 6) & (end < 10)'\n", + " '(tour_type == \"escort\") & (end > 9) & (end < 13)'\n", + " '(tour_type == \"escort\") & (end > 12) & (end < 15)'\n", + " '(tour_type == \"escort\") & (end == 15)'\n", + " '(tour_type == \"escort\") & (end == 16)'\n", + " '(tour_type == \"escort\") & (end == 17)'\n", + " '(tour_type == \"escort\") & (end == 18)'\n", + " '(tour_type == \"escort\") & (end > 18) & (end < 22)'\n", + " '(tour_type == \"escort\") & (end > 21)'\n", + " '(tour_type == \"escort\") & (duration < 2)'\n", + " '(tour_type == \"escort\") & (duration > 1) & (duration < 4)'\n", + " '(tour_type == \"escort\") & (duration > 3) & (duration < 6)'\n", + " '(tour_type == \"escort\") & (duration > 5) & (duration < 8)'\n", + " '(tour_type == \"escort\") & (duration > 7) & (duration < 11)'\n", + " '(tour_type == \"escort\") & (duration > 10) & (duration < 14)'\n", + " '(tour_type == \"escort\") & (duration > 13) & (duration < 19)']\n", "Choices:\n", - "count 1058.000000\n", - "mean 65.284499\n", - "std 50.422260\n", - "min 0.000000\n", - "25% 18.000000\n", - "50% 52.000000\n", - "75% 96.750000\n", - "max 189.000000\n", + "count 110.000000\n", + "mean 159.709091\n", + "std 66.475124\n", + "min 0.000000\n", + "25% 187.000000\n", + "50% 188.000000\n", + "75% 189.000000\n", + "max 189.000000\n", "dtype: float64\n", - "Time to execute model 'non_mandatory_scheduling': 3.48s\n", - "Total time to execute: 3.48s\n" + "Time to execute model 'non_mandatory_scheduling': 3.23s\n", + "Total time to execute: 3.23s\n" ] } ], - "prompt_number": 17 + "prompt_number": 15 }, { "cell_type": "code", @@ -890,49 +1032,14 @@ "stream": "stdout", "text": [ "Running model 'mode_choice_simulate'\n", - " work\n", - "Expression Alternative \n", - "sov_available == False DRIVEALONEFREE -999.000000\n", - "auto_ownership == 0 DRIVEALONEFREE -999.000000\n", - "age < 16 DRIVEALONEFREE -999.000000\n", - "is_joint DRIVEALONEFREE -999.000000\n", - "work_tour_is_drive DRIVEALONEFREE -999.000000\n", - "@out_skims['SOV_TIME'] + in_skims['SOV_TIME'] DRIVEALONEFREE -0.017500\n", - "2 * terminal_time DRIVEALONEFREE -0.035000\n", - "@costPerMile * (out_skims['SOV_DIST'] + in_skims['SOV_DIST']) DRIVEALONEFREE -0.001313\n", - "daily_parking_cost DRIVEALONEFREE -0.001313\n", - "@out_skims['SOV_BTOLL'] + in_skims['SOV_BTOLL'] DRIVEALONEFREE -0.001313\n", - "age_16_to_19 DRIVEALONEFREE 0.000000\n", - "sovtoll_available == False DRIVEALONEPAY -999.000000\n", - "auto_ownership == 0 DRIVEALONEPAY -999.000000\n", - "age < 16 DRIVEALONEPAY -999.000000\n", - "is_joint DRIVEALONEPAY -999.000000\n", - "work_tour_is_drive DRIVEALONEPAY -999.000000\n", - "@out_skims['SOVTOLL_TIME'] + in_skims['SOVTOLL_TIME'] DRIVEALONEPAY -0.017500\n", - "2 * terminal_time DRIVEALONEPAY -0.035000\n", - "@costPerMile * (out_skims['SOVTOLL_DIST'] + in_skims['SOVTOLL_DIST']) DRIVEALONEPAY -0.001313\n", - "daily_parking_cost DRIVEALONEPAY -0.001313\n", - "@out_skims['SOVTOLL_BTOLL'] + in_skims['SOVTOLL_BTOLL'] DRIVEALONEPAY -0.001313\n", - "@out_skims['SOVTOLL_VTOLL'] + in_skims['SOVTOLL_VTOLL'] DRIVEALONEPAY -0.001313\n", - "age_16_to_19 DRIVEALONEPAY 0.000000\n", - "hov2_available == False SHARED2FREE -999.000000\n", - "is_joint & (number_of_participants > 2) SHARED2FREE -999.000000\n", - "@out_skims['HOV2_TIME'] + in_skims['HOV2_TIME'] SHARED2FREE -0.017500\n", - "2 * terminal_time SHARED2FREE -0.035000\n", - "@costPerMile * (out_skims['HOV2_DIST'] + in_skims['HOV2_DIST']) SHARED2FREE -0.001313\n", - "@df.daily_parking_cost / costShareSr2 SHARED2FREE -0.001313\n", - "@(out_skims['HOV2_BTOLL'] + in_skims['HOV2_BTOLL']) / costShareSr2 SHARED2FREE -0.001313\n", - "hhsize == 1 SHARED2FREE 0.000000\n", - "hhsize == 2 SHARED2FREE 0.000000\n", - "age_16_p SHARED2FREE -1.366000" + "WARNING, skipping key: " ] }, { "output_type": "stream", "stream": "stdout", "text": [ - "\n", - "WARNING, skipping key: DISTANCE\n", + " DISTANCE\n", "WARNING, skipping key: " ] }, @@ -949,26 +1056,26 @@ "stream": "stdout", "text": [ "['2 * terminal_time' '@df.daily_parking_cost / costShareSr2 '\n", + " \"@out_skims['HOV2_TIME'] + in_skims['HOV2_TIME']\"\n", + " \"@out_skims['SOVTOLL_BTOLL'] + in_skims['SOVTOLL_BTOLL']\"\n", + " \"@out_skims['SOVTOLL_TIME'] + in_skims['SOVTOLL_TIME']\"\n", + " \"@out_skims['SOVTOLL_VTOLL'] + in_skims['SOVTOLL_VTOLL']\"\n", + " \"@out_skims['SOV_BTOLL'] + in_skims['SOV_BTOLL']\"\n", + " \"@out_skims['SOV_TIME'] + in_skims['SOV_TIME']\" 'age_16_to_19'\n", " 'daily_parking_cost' 'hov2_available == False' 'is_joint'\n", " 'is_joint & (number_of_participants > 2)' 'sov_available == False'\n", " 'sovtoll_available == False' 'work_tour_is_drive']\n", - "Choices:\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "2 711\n", - "0 615\n", - "1 553\n", + "Choices:\n", + "1 40\n", + "0 35\n", + "2 24\n", "dtype: int64\n", - "Time to execute model 'mode_choice_simulate': 5.89s\n", - "Total time to execute: 5.89s\n" + "Time to execute model 'mode_choice_simulate': 2.77s\n", + "Total time to execute: 2.77s\n" ] } ], - "prompt_number": 18 + "prompt_number": 16 }, { "cell_type": "code", @@ -1040,7 +1147,7 @@ ] } ], - "prompt_number": 13 + "prompt_number": 17 }, { "cell_type": "code", @@ -1056,91 +1163,81 @@ "stream": "stdout", "text": [ "\n", - "Int64Index: 1000 entries, 1669190 to 1400683\n", - "Data columns (total 77 columns):\n", - "TAZ 1000 non-null int64\n", - "SERIALNO 1000 non-null int64\n", - "PUMA5 1000 non-null int64\n", - "income 1000 non-null int64\n", - "PERSONS 1000 non-null int64\n", - "HHT 1000 non-null int64\n", - "UNITTYPE 1000 non-null int64\n", - "NOC 1000 non-null int64\n", - "BLDGSZ 1000 non-null int64\n", - "TENURE 1000 non-null int64\n", - "VEHICL 1000 non-null int64\n", - "hinccat1 1000 non-null int64\n", - "hinccat2 1000 non-null int64\n", - "hhagecat 1000 non-null int64\n", - "hsizecat 1000 non-null int64\n", - "hfamily 1000 non-null int64\n", - "hunittype 1000 non-null int64\n", - "hNOCcat 1000 non-null int64\n", - "hwrkrcat 1000 non-null int64\n", - "h0004 1000 non-null int64\n", - "h0511 1000 non-null int64\n", - "h1215 1000 non-null int64\n", - "h1617 1000 non-null int64\n", - "h1824 1000 non-null int64\n", - "h2534 1000 non-null int64\n", - "h3549 1000 non-null int64\n", - "h5064 1000 non-null int64\n", - "h6579 1000 non-null int64\n", - "h80up 1000 non-null int64\n", - "workers 1000 non-null int64\n", - "hwork_f 1000 non-null int64\n", - "hwork_p 1000 non-null int64\n", - "huniv 1000 non-null int64\n", - "hnwork 1000 non-null int64\n", - "hretire 1000 non-null int64\n", - "hpresch 1000 non-null int64\n", - "hschpred 1000 non-null int64\n", - "hschdriv 1000 non-null int64\n", - "htypdwel 1000 non-null int64\n", - "hownrent 1000 non-null int64\n", - "hadnwst 1000 non-null int64\n", - "hadwpst 1000 non-null int64\n", - "hadkids 1000 non-null int64\n", - "bucketBin 1000 non-null int64\n", - "originalPUMA 1000 non-null int64\n", - "hmultiunit 1000 non-null int64\n", - "has_preschool_kid 1000 non-null bool\n", - "family 1000 non-null bool\n", - "num_young_adults 1000 non-null float64\n", - "auto_ownership 1000 non-null int64\n", - "has_driving_kid 1000 non-null bool\n", - "has_preschool_kid_at_home 1000 non-null bool\n", - "home_taz 1000 non-null int64\n", - "has_retiree 1000 non-null bool\n", - "drivers 1000 non-null float64\n", - "hhsize 1000 non-null int64\n", - "num_under16_not_at_school 1000 non-null int64\n", - "has_non_worker 1000 non-null bool\n", - "num_children 1000 non-null float64\n", - "car_sufficiency 1000 non-null int64\n", - "num_adolescents 1000 non-null float64\n", - "income_in_thousands 1000 non-null float64\n", - "has_school_kid 1000 non-null bool\n", - "num_college_age 1000 non-null float64\n", - "non_workers 1000 non-null int64\n", - "household_type 957 non-null object\n", - "home_is_rural 1000 non-null bool\n", - "work_tour_auto_time_savings 1000 non-null int64\n", - "non_family 1000 non-null bool\n", - "has_university 1000 non-null bool\n", - "income_segment 1000 non-null category\n", - "has_full_time 1000 non-null bool\n", - "has_part_time 1000 non-null bool\n", - "has_school_kid_at_home 1000 non-null bool\n", - "no_cars 1000 non-null bool\n", - "num_young_children 1000 non-null float64\n", - "home_is_urban 1000 non-null bool\n", - "dtypes: bool(15), category(1), float64(7), int64(53), object(1)\n", - "memory usage: 500.0 KB\n" + "Int64Index: 100 entries, 2624246 to 558870\n", + "Data columns (total 67 columns):\n", + "TAZ 100 non-null int64\n", + "SERIALNO 100 non-null int64\n", + "PUMA5 100 non-null int64\n", + "income 100 non-null int64\n", + "PERSONS 100 non-null int64\n", + "HHT 100 non-null int64\n", + "UNITTYPE 100 non-null int64\n", + "NOC 100 non-null int64\n", + "BLDGSZ 100 non-null int64\n", + "TENURE 100 non-null int64\n", + "VEHICL 100 non-null int64\n", + "hinccat1 100 non-null int64\n", + "hinccat2 100 non-null int64\n", + "hhagecat 100 non-null int64\n", + "hsizecat 100 non-null int64\n", + "hfamily 100 non-null int64\n", + "hunittype 100 non-null int64\n", + "hNOCcat 100 non-null int64\n", + "hwrkrcat 100 non-null int64\n", + "h0004 100 non-null int64\n", + "h0511 100 non-null int64\n", + "h1215 100 non-null int64\n", + "h1617 100 non-null int64\n", + "h1824 100 non-null int64\n", + "h2534 100 non-null int64\n", + "h3549 100 non-null int64\n", + "h5064 100 non-null int64\n", + "h6579 100 non-null int64\n", + "h80up 100 non-null int64\n", + "workers 100 non-null int64\n", + "hwork_f 100 non-null int64\n", + "hwork_p 100 non-null int64\n", + "huniv 100 non-null int64\n", + "hnwork 100 non-null int64\n", + "hretire 100 non-null int64\n", + "hpresch 100 non-null int64\n", + "hschpred 100 non-null int64\n", + "hschdriv 100 non-null int64\n", + "htypdwel 100 non-null int64\n", + "hownrent 100 non-null int64\n", + "hadnwst 100 non-null int64\n", + "hadwpst 100 non-null int64\n", + "hadkids 100 non-null int64\n", + "bucketBin 100 non-null int64\n", + "originalPUMA 100 non-null int64\n", + "hmultiunit 100 non-null int64\n", + "num_college_age 100 non-null float64\n", + "non_workers 100 non-null int64\n", + "income_segment 100 non-null category\n", + "family 100 non-null bool\n", + "num_young_adults 100 non-null float64\n", + "household_type 96 non-null object\n", + "auto_ownership 100 non-null int64\n", + "drivers 100 non-null int64\n", + "income_in_thousands 100 non-null float64\n", + "home_is_rural 100 non-null bool\n", + "work_tour_auto_time_savings 100 non-null int64\n", + "num_under16_not_at_school 100 non-null int64\n", + "hhsize 100 non-null int64\n", + "num_children 100 non-null float64\n", + "car_sufficiency 100 non-null int64\n", + "non_family 100 non-null bool\n", + "num_adolescents 100 non-null float64\n", + "no_cars 100 non-null bool\n", + "num_young_children 100 non-null float64\n", + "home_is_urban 100 non-null bool\n", + "home_taz 100 non-null int64\n", + "dtypes: bool(5), category(1), float64(6), int64(54), object(1)\n", + "memory usage: 49.1 KB\n" ] } ], - "prompt_number": 14 + "prompt_number": 18 }, { "cell_type": "code", @@ -1156,64 +1253,82 @@ "stream": "stdout", "text": [ "\n", - "Int64Index: 2598 entries, 1394 to 7051868\n", - "Data columns (total 50 columns):\n", - "household_id 2598 non-null int64\n", - "age 2598 non-null int64\n", - "RELATE 2598 non-null int64\n", - "ESR 2598 non-null int64\n", - "GRADE 2598 non-null int64\n", - "PNUM 2598 non-null int64\n", - "PAUG 2598 non-null int64\n", - "DDP 2598 non-null int64\n", - "sex 2598 non-null int64\n", - "WEEKS 2598 non-null int64\n", - "HOURS 2598 non-null int64\n", - "MSP 2598 non-null int64\n", - "POVERTY 2598 non-null int64\n", - "EARNS 2598 non-null int64\n", - "pagecat 2598 non-null int64\n", - "pemploy 2598 non-null int64\n", - "pstudent 2598 non-null int64\n", - "ptype 2598 non-null int64\n", - "padkid 2598 non-null int64\n", - "student_cat 2598 non-null object\n", - "num_eat_j 2598 non-null int64\n", - "distance_to_school 2598 non-null float64\n", - "female 2598 non-null bool\n", - "non_mandatory_tour_frequency 1744 non-null float64\n", - "max_window 2598 non-null int64\n", - "employed_cat 2598 non-null object\n", - "student_is_employed 2598 non-null bool\n", - "distance_to_work 2598 non-null float64\n", - "cdap_activity 2598 non-null object\n", - "num_main_j 2598 non-null int64\n", - "num_joint_tours 2598 non-null int64\n", - "home_taz 2598 non-null int64\n", - "ptype_cat 2598 non-null object\n", - "is_student 2598 non-null bool\n", - "under16_not_at_school 2598 non-null bool\n", - "school_taz 2598 non-null int64\n", - "is_worker 2598 non-null bool\n", - "roundtrip_auto_time_to_school 2598 non-null float64\n", - "age_16_p 2598 non-null bool\n", - "workplace_taz 2598 non-null int64\n", - "workplace_in_cbd 2598 non-null bool\n", - "mandatory_tour_frequency 856 non-null object\n", - "age_16_to_19 2598 non-null bool\n", - "nonstudent_to_school 2598 non-null bool\n", - "num_shop_j 2598 non-null int64\n", - "num_mand 2598 non-null float64\n", - "num_visi_j 2598 non-null int64\n", - "roundtrip_auto_time_to_work 2598 non-null float64\n", - "num_disc_j 2598 non-null int64\n", - "male 2598 non-null bool\n", - "dtypes: bool(10), float64(6), int64(29), object(5)\n", - "memory usage: 857.5 KB\n" + "Int64Index: 267 entries, 84601 to 6968468\n", + "Data columns (total 68 columns):\n", + "household_id 267 non-null int64\n", + "age 267 non-null int64\n", + "RELATE 267 non-null int64\n", + "ESR 267 non-null int64\n", + "GRADE 267 non-null int64\n", + "PNUM 267 non-null int64\n", + "PAUG 267 non-null int64\n", + "DDP 267 non-null int64\n", + "sex 267 non-null int64\n", + "WEEKS 267 non-null int64\n", + "HOURS 267 non-null int64\n", + "MSP 267 non-null int64\n", + "POVERTY 267 non-null int64\n", + "EARNS 267 non-null int64\n", + "pagecat 267 non-null int64\n", + "pemploy 267 non-null int64\n", + "pstudent 267 non-null int64\n", + "ptype 267 non-null int64\n", + "padkid 267 non-null int64\n", + "has_preschool_kid 267 non-null bool\n", + "student_cat 267 non-null object\n", + "num_eat_j 267 non-null int64\n", + "has_driving_kid 267 non-null bool\n", + "home_taz 267 non-null int64\n", + "work_and_school_and_worker 267 non-null bool\n", + "work_and_school_and_student 267 non-null bool\n", + "female 267 non-null bool\n", + "has_preschool_kid_at_home 267 non-null bool\n", + "has_full_time 267 non-null bool\n", + "is_university 267 non-null bool\n", + "max_window 267 non-null int64\n", + "employed_cat 267 non-null object\n", + "student_is_employed 267 non-null bool\n", + "is_gradeschool 267 non-null bool\n", + "is_highschool 267 non-null bool\n", + "has_retiree 267 non-null bool\n", + "cdap_activity 267 non-null object\n", + "num_main_j 267 non-null int64\n", + "num_joint_tours 267 non-null int64\n", + "has_non_worker 267 non-null bool\n", + "ptype_cat 267 non-null object\n", + "is_student 267 non-null bool\n", + "under16_not_at_school 267 non-null bool\n", + "has_school_kid 267 non-null bool\n", + "school_taz 267 non-null float64\n", + "is_worker 267 non-null bool\n", + "roundtrip_auto_time_to_school 267 non-null float64\n", + "distance_to_school 267 non-null float64\n", + "age_16_p 267 non-null bool\n", + "workplace_taz 267 non-null int64\n", + "workplace_in_cbd 267 non-null bool\n", + "has_university 267 non-null bool\n", + "adult 267 non-null bool\n", + "non_mandatory_tour_frequency 164 non-null float64\n", + "nonstudent_to_school 267 non-null bool\n", + "age_16_to_19 267 non-null bool\n", + "num_non_escort_tours 267 non-null float64\n", + "mandatory_tour_frequency 80 non-null object\n", + "num_shop_j 267 non-null int64\n", + "num_mand 267 non-null float64\n", + "num_visi_j 267 non-null int64\n", + "num_escort_tours 267 non-null float64\n", + "roundtrip_auto_time_to_work 267 non-null float64\n", + "num_disc_j 267 non-null int64\n", + "has_part_time 267 non-null bool\n", + "has_school_kid_at_home 267 non-null bool\n", + "distance_to_work 267 non-null float64\n", + "male 267 non-null bool\n", + "dtypes: bool(26), float64(9), int64(28), object(5)\n", + "memory usage: 96.5 KB\n" ] } ], - "prompt_number": 15 + "prompt_number": 19 }, { "cell_type": "heading", @@ -1252,7 +1367,24 @@ "language": "python", "metadata": {}, "outputs": [], - "prompt_number": 15 + "prompt_number": 19 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 19 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] } ], "metadata": {}