biogeme.results_processing.html_output module

Generates an HTML output

Michel Bierlaire Wed Oct 2 16:10:54 2024

biogeme.results_processing.html_output.format_real_number(value)[source]

Format a real number to be included in the HTML table

Return type:

str

Parameters:

value (float)

biogeme.results_processing.html_output.generate_html_file(estimation_results, filename, overwrite=False, variance_covariance_type=None)[source]

Generate an HTML file with the estimation results

Parameters:
  • estimation_results (EstimationResults) – estimation results

  • filename (str) – name of the file

  • overwrite – if True and the file exists, it is overwritten

  • variance_covariance_type (EstimateVarianceCovariance | None) – select which type of variance-covariance matrix is used to generate the statistics. If None, the bootstrap one is used if available. If not available, the robust one.

Return type:

None

biogeme.results_processing.html_output.get_html_condition_number(estimation_results)[source]

Report the smallest and largest eigenvalues, and the condition number.

Parameters:

estimation_results (EstimationResults) – estimation results

Return type:

str

Returns:

HTML code

biogeme.results_processing.html_output.get_html_correlation_results(estimation_results, variance_covariance_type=None, involved_parameters=None)[source]

Get the correlation results in an HTML format

Parameters:
  • estimation_results (EstimationResults) – estimation results.

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

  • involved_parameters (dict[str, str] | None) – a dict that identifies the parameters to involve, as assign them with a name for the reporting.

Return type:

str

Returns:

HTML code

biogeme.results_processing.html_output.get_html_estimated_parameters(estimation_results, variance_covariance_type=None, renaming_parameters=None, sort_by_name=False)[source]

Get the estimated parameters coded in HTML

Parameters:
  • estimation_results (EstimationResults) – estimation results.

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

  • renaming_parameters (dict[str, str] | None) – a dict that suggests new names for some or all parameters.

  • sort_by_name (bool) – if True, parameters are sorted alphabetically by name.

Return type:

str

Returns:

HTML code

Prepare the footer for the HTML file, containing comments and the version of Biogeme.

Return type:

str

biogeme.results_processing.html_output.get_html_general_statistics(estimation_results)[source]

Get the general statistics coded in HTML

Return type:

str

Returns:

HTML code

Parameters:

estimation_results (EstimationResults)

biogeme.results_processing.html_output.get_html_header(estimation_results)[source]

Prepare the header for the HTML file, containing comments and the version of Biogeme.

Return type:

str

Returns:

string containing the header.

Parameters:

estimation_results (EstimationResults)

biogeme.results_processing.html_output.get_html_one_pair_of_parameters(estimation_results, first_parameter_index, second_parameter_index, variance_covariance_type, first_parameter_name=None, second_parameter_name=None)[source]

Generate one row of the HTML table of the correlation data for estimated parameters.

Parameters:
  • estimation_results (EstimationResults) – estimation results.

  • first_parameter_index (int) – index of the first parameter

  • second_parameter_index (int) – index of the second parameter

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

  • first_parameter_name – name of the parameter to report. If None, taken from estimation results.

  • second_parameter_name – name of the parameter to report. If None, taken from estimation results.

Return type:

str

Returns:

one row of the table

biogeme.results_processing.html_output.get_html_one_parameter(estimation_results, parameter_index, variance_covariance_type, parameter_number=None, parameter_name=None)[source]

Generate the HTML code for one row of the table of the estimated parameters.

Parameters:
  • estimation_results (EstimationResults) – estimation results.

  • parameter_index (int) – index of the parameter

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

  • parameter_number – number of the parameter to report. If None, it is the index.

  • parameter_name – name of the parameter to report. If None, taken from estimation results.

Returns:

HTML code for the row

biogeme.results_processing.html_output.get_html_preamble(estimation_results, file_name)[source]

Generates the first part of the HTML, with the preamble information.

Parameters:
  • estimation_results (EstimationResults) – estimation results

  • file_name (str) – name of the HTML file (used only for reporting)

Return type:

str

Returns:

HTML code