GravityModelCalibrateResults#

class caf.distribute.gravity_model.core.GravityModelCalibrateResults(cost_distribution, cost_convergence, value_distribution, target_cost_distribution, cost_function, cost_params)#

Bases: GravityModelResults

A collection of results from a run of the Gravity Model.

Parameters:
  • cost_distribution (caf.toolkit.cost_utils.CostDistribution) – The achieved cost distribution of the run.

  • cost_convergence (float) – The achieved cost convergence value of the run. If target_cost_distribution is not set, then this should be 0. This will be the same as calculating the convergence of cost_distribution and target_cost_distribution.

  • value_distribution (numpy.ndarray) – The achieved distribution of the given values (usually trip values between different places).

  • target_cost_distribution (caf.toolkit.cost_utils.CostDistribution) – The cost distribution the gravity model was aiming for during its run.

  • cost_function (caf.distribute.cost_functions.CostFunction) – The cost function used in the gravity model run.

  • cost_params (dict[str, Any]) – The cost parameters used with the cost_function to achieve the results.

Methods Summary

plot_distributions()

Plot a comparison of the achieved and target distributions.

Methods Documentation

plot_distributions()#

Plot a comparison of the achieved and target distributions.

This method returns a matplotlib figure which can be saved or plotted as the user decides.

Return type:

Figure