Last active
July 25, 2018 22:00
-
-
Save smmaurer/5bdffb55ba135686c670c12d7f38d7f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import orca | |
import pandas as pd | |
from urbansim_templates import modelmanager as mm # Orca extension for managing template steps | |
from urbansim_templates.models import BinaryLogitStep | |
mm.initialize() # load any saved steps from the local project directory | |
df = pd.read_csv('households.csv') | |
orca.add_table('households', df) | |
m = BinaryLogitStep() # start building a template-based model step | |
m.tables = ['households'] | |
m.model_expression = 'recent_mover ~ age + cost_burden + tenure' | |
m.fit() # estimate a logit model and display the results | |
m.out_column = 'unit_id' # in the simulation, predicting a move means | |
m.out_value_true = -1 | |
m.name = 'household-relocation-v1' | |
m.register() # register the model step with Orca, and save it to disk for later use | |
mm.list_steps() | |
orca.run(['real-estate-price-model', 'household-relocation-v1', 'household-location-choice']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment