biogeme.segmentation.segmentation module

Class that provides some automatic specification for segmented parameters

Michel Bierlaire Thu Apr 3 12:07:44 2025

class biogeme.segmentation.segmentation.Segmentation(beta, segmentation_tuples, prefix='segmented')[source]

Bases: object

Segmentation of a parameter, possibly with multiple socio-economic variables

Parameters:
beta_ref_code()[source]

Constructs the Python code for the parameter

Returns:

Python code

Return type:

str

calculates_estimated_values(estimation_results)[source]

Calculates the estimated values of the parameter for each segment.

Parameters:

estimation_results (EstimationResults) – results of the estimation

Return type:

DataFrame

Returns:

a pandas data frame with the definition of the segments and the corresponding values for the

coefficient

get_beta_ref_name()[source]

Add a suffix to the name of the parameter

Return type:

str

get_reference_beta()[source]

Obtain the reference beta

Return type:

Beta

segmented_beta()[source]

Create an expressions that combines all the segments

Returns:

combined expression

Return type:

biogeme.expressions.Expression

segmented_code()[source]

Create the Python code for an expressions that combines all the segments

Returns:

Python code for the combined expression

Return type:

str