Skip to content

Commit

Permalink
LocationChoiceModel -> MNLLocationChoiceModel.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiffyclub committed Apr 29, 2014
1 parent e60c2c0 commit f8d60fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion urbansim/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .regression import RegressionModel, RegressionModelGroup
from .lcm import LocationChoiceModel
from .lcm import MNLLocationChoiceModel
5 changes: 3 additions & 2 deletions urbansim/models/lcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ def unit_choice(chooser_ids, alternative_ids, probabilities):
return choices


class LocationChoiceModel(object):
class MNLLocationChoiceModel(object):
"""
A location choice model with the ability to store an estimated
model and predict new data based on the model.
Based on multinomial logit.
Parameters
----------
Expand All @@ -94,7 +95,7 @@ def __init__(self, alts_fit_filters, alts_predict_filters,
# LCMs never have a constant
self.model_expression = model_expression + ' - 1'
self.sample_size = sample_size
self.name = name or 'LocationChoiceModel'
self.name = name or 'MNLLocationChoiceModel'

self._log_lks = None
self._model_columns = None
Expand Down
4 changes: 2 additions & 2 deletions urbansim/models/tests/test_lcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def test_unit_choice_none_available(choosers, alternatives):
assert choices.isnull().all()


def test_lcm(choosers, alternatives):
model = lcm.LocationChoiceModel(
def test_mnl_lcm(choosers, alternatives):
model = lcm.MNLLocationChoiceModel(
['var3 != 15'], ['var2 != 14'], 'var2 + var1:var3', 5,
name='Test LCM')
loglik = model.fit(choosers, alternatives, choosers.thing_id)
Expand Down

0 comments on commit f8d60fe

Please sign in to comment.