biogeme.results_processing.compilation module

Compilation of estimation results

Michel Bierlaire Thu Oct 3 18:54:13 2024

biogeme.results_processing.compilation.compile_estimation_results(dict_of_results, variance_covariance_type=EstimateVarianceCovariance.ROBUST, statistics=('Number of estimated parameters', 'Sample size', 'Final log likelihood', 'Akaike Information Criterion', 'Bayesian Information Criterion'), include_parameter_estimates=True, include_stderr=False, include_t_test=True, formatted=True, use_short_names=False)[source]

Compile estimation results into a common table

Parameters:
  • dict_of_results (dict[str, EstimationResults | str]) – dict of results, containing for each model the name, the ID and the results, or the name of the pickle file containing them.

  • variance_covariance_type (EstimateVarianceCovariance) – type of variance-covariance estimate to be used.

  • statistics (tuple[str, ...]) – list of statistics to include in the summary table

  • include_parameter_estimates (bool) – if True, the parameter estimates are included.

  • include_stderr (bool) – if True, the robust standard errors of the parameters are included.

  • include_t_test (bool) – if True, the t-test of the parameters are included.

  • formatted (bool) – if True, a formatted string in included in the table results. If False, the numerical values are stored. Use “True” if you need to print the results. Use “False” if you need to use them for further calculation.

  • use_short_names (bool) – if True, short names, such as Model_1, Model_2, are used to identify the model. It is nicer on for the reporting.

Return type:

tuple[DataFrame, dict[str, str]]

Returns:

pandas dataframe with the requested results, and a dictionary reporting the specification of each model

biogeme.results_processing.compilation.compile_results_in_directory(statistics=('Number of estimated parameters', 'Sample size', 'Final log likelihood', 'Akaike Information Criterion', 'Bayesian Information Criterion'), file_extension='yaml', variance_covariance_type=EstimateVarianceCovariance.ROBUST, include_parameter_estimates=True, include_stderr=False, include_t_test=True, formatted=True, use_short_names=False)[source]
Compile estimation results found in the local directory into a

common table. The results are supposed to be in a file with pickle extension.

Parameters:
  • statistics (tuple[str, ...]) – list of statistics to include in the summary table

  • file_extension (str) – extension of the files containing the estimation results.

  • variance_covariance_type (EstimateVarianceCovariance) – type of variance-covariance estimate to be used.

  • include_parameter_estimates (bool) – if True, the parameter estimates are included.

  • include_stderr (bool) – if True, the robust standard errors of the parameters are included.

  • include_t_test (bool) – if True, the t-test of the parameters are included.

  • formatted (bool) – if True, a formatted string in included in the table results. If False, the numerical values are stored. Use “True” if you need to print the results. Use “False” if you need to use them for further calculation.

  • use_short_names (bool) – if True, short names, such as Model_1, Model_2, are used to identify the model. It is nicer on for the reporting.

Return type:

tuple[DataFrame, dict[str, str]] | None

Returns:

pandas dataframe with the requested results, and a dictionary reporting the specification of each model