MultiDistInput#
- class caf.distribute.gravity_model.multi_area.MultiDistInput(*, tld_file, tld_lookup_file, cat_col, min_col, max_col, ave_col, trips_col, lookup_cat_col, lookup_zone_col, init_params, log_path, furness_tolerance=1e-06, furness_jac=False)#
Bases:
BaseConfigInput to multi cost distribution calibrator.
- Parameters:
tld_file (Path) – Path to a file containing distributions. This should contain 5 columns, the names of which must be specified below.
tld_lookup_file (Path) – Path to a lookup from distribution areas to zones. Should contain 2 columns which are explained below.
cat_col (str) – The name of the column containing distribution area/categories in TLDFile. E.g. ‘City’, ‘Village’, ‘Town’, if there are different distributions for these different are types
min_col (str) – The name of the column containing lower bounds of cost bands.
max_col (str) – The name of the column containing upper bounds of cost bands.
ave_col (str) – The name of the column containing average values of cost bands.
trips_col (str) – The name of the column containing numbers of trips for a given cost band.
lookup_cat_col (str) – The name of the column in the lookup containing the categories. The names of the values (but not the column name) must match the names in the cat_col of the TLD file. There must not be any distributions defined in the TLDFile which do not appear in the lookup.
lookup_zone_col (str) – The column in the lookup containing zone identifiers. The lookup must contain all zones in the zone system.
init_params (dict[str, float]) – A dict containing init_params for the cost function when calibrating. If left blank the default value from the cost_function will be used.
log_path (Path) – Path to where the log file should be saved. Saved as a csv but this can also be a path to a txt file.
furness_tolerance (float) – The tolerance for the furness in the gravity function. In general lower tolerance will take longer but may yield better results.
furness_jac (bool) – Whether to furness within the jacobian function. Not furnessing within the jacobian does not represent knock on effects to other areas of altering parameters for a given area. If you expect these effects to be significant this should be set to True, but otherwise the process runs quicker with it set to False.
Attributes Summary
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Attributes Documentation
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].