Skip to content

Commit

Permalink
now the segmentation is running for simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
fscottfoti committed Jun 5, 2014
1 parent 30538de commit bcbc5f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion urbansim/models/yamlmodelrunner.py
Expand Up @@ -46,7 +46,11 @@ def hedonic_simulate(df, cfgname, outdf, outfname):
"""
print "Running hedonic simulation\n"
cfg = misc.config(cfgname)
hm = RegressionModel.from_yaml(str_or_buffer=cfg)
model_type = yaml.load(open(cfg))["model_type"]
if model_type == "regression":
hm = RegressionModel.from_yaml(str_or_buffer=cfg)
if model_type == "segmented_regression":
hm = SegmentedRegressionModel.from_yaml(str_or_buffer=cfg)
price_or_rent = hm.predict(df)
print price_or_rent.describe()
outdf.loc[price_or_rent.index.values, outfname] = price_or_rent
Expand Down

0 comments on commit bcbc5f0

Please sign in to comment.