polaris.analyze.kpi_comparator.KpiComparator#
- class polaris.analyze.kpi_comparator.KpiComparator#
Bases:
object
This class provides an easy way to group together multiple runs of POLARIS and compare their outputs. Runs KPIs are added along with a string based name which is used as the label for that run in any subsequent plots which are generated.
from polaris.analyze.kpi_comparator import KpiComparator results = KpiComparator() results.add_run(ResultKPIs.from_iteration(ref_project_dir / f"{city}_iteration_2"), 'REF_iteration_2') results.add_run(ResultKPIs.from_iteration(eval_project_dir / f"{city}_iteration_2"), 'EVAL_iteration_2')
Metric comparison plots can then be generated in a notebook using:
results.plot_mode_share() results.plot_vmt() results.plot_vmt_by_link_type()
Any number of runs can be added using add_run up to the limit of readability on the generated plots.
The object can also be used to generate a set of csv files for input into Excel (if you really have to use Excel):
results.dump_to_csvs(output_dir = "my_csv_dump_dir")
- __init__()#
Methods
__init__
()across_iterations
(cols, **kwargs)add_iter
()add_run
(kpi, run_id)dump_to_csvs
(output_dir[, metrics_to_dump])has_run
(run_id)plot_act_dist
([act_type])plot_activity_start_time_distributions
(**kwargs)plot_calibration_destination
(**kwargs)plot_calibration_for_mode_share
(**kwargs)plot_calibration_timing
(**kwargs)plot_congestion_pricing
(**kwargs)plot_cpu_mem
(**kwargs)plot_everything
(**kwargs)plot_gaps
(**kwargs)plot_mode_share
(**kwargs)plot_multiple_gaps
(kpi_results)plot_network_gaps
(**kwargs)plot_pax_in_network
(**kwargs)plot_population
(**kwargs)plot_rmse_vs_observed
(**kwargs)plot_skim_stats
([show_min_max])plot_tnc
(**kwargs)plot_transit
(**kwargs)plot_trip_length_distributions
([max_dist])plot_vehicle_connectivity
(**kwargs)plot_vmt
(**kwargs)plot_vmt_by_link_type
(**kwargs)- __init__()#
- add_run(kpi: ResultKPIs, run_id: str)#
- has_run(run_id)#
- dump_to_csvs(output_dir, metrics_to_dump=None, **kwargs)#
- plot_everything(**kwargs)#
- classmethod available_plots()#
- plot_population(**kwargs)#
- plot_congestion_pricing(**kwargs)#
- plot_transit(**kwargs)#
- add_iter()#
- across_iterations(cols, **kwargs)#
- plot_act_dist(act_type: str | None = None, **kwargs)#
- plot_vmt(**kwargs)#
- plot_vehicle_connectivity(**kwargs)#
- plot_vmt_by_link_type(**kwargs)#
- plot_gaps(**kwargs)#
- static plot_multiple_gaps(kpi_results)#
- plot_pax_in_network(**kwargs)#
- plot_cpu_mem(**kwargs)#
- plot_network_gaps(**kwargs)#
- plot_skim_stats(show_min_max=False, **kwargs)#
- plot_trip_length_distributions(max_dist=None, **kwargs)#
- plot_activity_start_time_distributions(**kwargs)#
- plot_tnc(**kwargs)#
- plot_rmse_vs_observed(**kwargs)#
- plot_calibration_for_activity_generation(**kwargs)#
- plot_calibration_timing(**kwargs)#
- plot_calibration_destination(**kwargs)#