NestedLogit.load_from_idata#
- classmethod NestedLogit.load_from_idata(idata, check=True)[source]#
Create a ModelBuilder instance from a DataTree object.
This class method has a few steps:
Construct a new instance of the model using the DataTree attrs
Build the model from the DataTree
Check if the model id matches the id in the DataTree loaded.
- Parameters:
- idata
xr.DataTree The DataTree object to load the model from.
- checkbool, optional
Whether to check if the model id matches the id in the DataTree loaded. Defaults to True.
- idata
- Returns:
ModelBuilderAn instance of the ModelBuilder class.
- Raises:
DifferentModelErrorIf the model id in the DataTree does not match the model id built.