.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/assisted/plot_simple_example.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_assisted_plot_simple_example.py: Example of a catalog ==================== Illustration of the concept of catalog. See `Bierlaire and Ortelli (2023) `_ Michel Bierlaire, EPFL Sun Apr 27 2025, 18:39:23 .. GENERATED FROM PYTHON SOURCE LINES 12-43 .. code-block:: Python import numpy as np from biogeme.catalog import ( Catalog, CentralController, generic_alt_specific_catalogs, segmentation_catalogs, ) from biogeme.data.swissmetro import ( CAR_AV_SP, CAR_CO, CAR_CO_SCALED, CAR_TT, CAR_TT_SCALED, CHOICE, SM_AV, SM_COST_SCALED, SM_TT_SCALED, TRAIN_AV_SP, TRAIN_COST, TRAIN_COST_SCALED, TRAIN_TT, TRAIN_TT_SCALED, read_data, ) from biogeme.expressions import Beta, Expression from biogeme.models import boxcox, loglogit, lognested from biogeme.nests import NestsForNestedLogit, OneNestForNestedLogit .. GENERATED FROM PYTHON SOURCE LINES 44-45 Function printing all configurations of an expression. .. GENERATED FROM PYTHON SOURCE LINES 45-54 .. code-block:: Python def print_all_configurations(expression: Expression) -> None: """Prints all configurations that an expression can take""" the_central_controller = CentralController(expression=expression) total = the_central_controller.number_of_configurations() print(f'Total: {total} configurations') for config_id in the_central_controller.all_configurations_ids: print(config_id) .. GENERATED FROM PYTHON SOURCE LINES 55-56 Parameters to be estimated. .. GENERATED FROM PYTHON SOURCE LINES 56-61 .. code-block:: Python asc_car = Beta('asc_car', 0, None, None, 0) asc_train = Beta('asc_train', 0, None, None, 0) b_time = Beta('b_time', 0, None, None, 0) b_cost = Beta('b_cost', 0, None, None, 0) .. GENERATED FROM PYTHON SOURCE LINES 62-63 Definition of the utility functions. .. GENERATED FROM PYTHON SOURCE LINES 63-67 .. code-block:: Python v_train = asc_train + b_time * TRAIN_TT_SCALED + b_cost * TRAIN_COST_SCALED v_swissmetro = b_time * SM_TT_SCALED + b_cost * SM_COST_SCALED v_car = asc_car + b_time * CAR_TT_SCALED + b_cost * CAR_CO_SCALED .. GENERATED FROM PYTHON SOURCE LINES 68-69 Associate utility functions with the numbering of alternatives. .. GENERATED FROM PYTHON SOURCE LINES 69-71 .. code-block:: Python v = {1: v_train, 2: v_swissmetro, 3: v_car} .. GENERATED FROM PYTHON SOURCE LINES 72-73 Associate the availability conditions with the alternatives. .. GENERATED FROM PYTHON SOURCE LINES 73-75 .. code-block:: Python av = {1: TRAIN_AV_SP, 2: SM_AV, 3: CAR_AV_SP} .. GENERATED FROM PYTHON SOURCE LINES 76-78 Definition of the model. This is the contribution of each observation to the log likelihood function. .. GENERATED FROM PYTHON SOURCE LINES 78-80 .. code-block:: Python log_probability_logit = loglogit(v, av, CHOICE) .. GENERATED FROM PYTHON SOURCE LINES 81-82 Nest definition. .. GENERATED FROM PYTHON SOURCE LINES 82-87 .. code-block:: Python mu_existing = Beta('mu_existing', 1, 1, 10, 0) existing = OneNestForNestedLogit(nest_param=mu_existing, list_of_alternatives=[1, 3]) nests = NestsForNestedLogit(choice_set=list(v), tuple_of_nests=(existing,)) .. GENERATED FROM PYTHON SOURCE LINES 88-89 Contribution to the log-likelihood. .. GENERATED FROM PYTHON SOURCE LINES 89-91 .. code-block:: Python log_probability_nested = lognested(v, av, nests, CHOICE) .. GENERATED FROM PYTHON SOURCE LINES 92-94 Definition of the catalog containing two models specifications: logit and nested logit. .. GENERATED FROM PYTHON SOURCE LINES 94-102 .. code-block:: Python model_catalog = Catalog.from_dict( catalog_name='model_catalog', dict_of_expressions={ 'logit': log_probability_logit, 'nested': log_probability_nested, }, ) .. GENERATED FROM PYTHON SOURCE LINES 103-104 Current status of the catalog. .. GENERATED FROM PYTHON SOURCE LINES 104-106 .. code-block:: Python print(model_catalog) .. rst-class:: sphx-glr-script-out .. code-block:: none [model_catalog: logit]LogLogit[choice=CHOICE]U=(1:((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED)), 2:((Beta('b_time', 0, None, None, 0) * SM_TT_SCALED) + (Beta('b_cost', 0, None, None, 0) * SM_COST_SCALED)), 3:((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED)))av=(1:TRAIN_AV_SP, 2:SM_AV, 3:CAR_AV_SP) .. GENERATED FROM PYTHON SOURCE LINES 107-108 Use the controller to select a different configuration. .. GENERATED FROM PYTHON SOURCE LINES 108-111 .. code-block:: Python model_catalog.controlled_by.set_name('nested') print(model_catalog) .. rst-class:: sphx-glr-script-out .. code-block:: none [model_catalog: nested]LogLogit[choice=CHOICE]U=(1:(((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED)) + (((Beta('mu_existing', 1, 1, 10, 0) - `1.0`) * ((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED))) + (((`1.0` / Beta('mu_existing', 1, 1, 10, 0)) - `1.0`) * log(ConditionalSum((TRAIN_AV_SP != `0.0`): exp((Beta('mu_existing', 1, 1, 10, 0) * ((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED)))), (CAR_AV_SP != `0.0`): exp((Beta('mu_existing', 1, 1, 10, 0) * ((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED))))))))), 2:(((Beta('b_time', 0, None, None, 0) * SM_TT_SCALED) + (Beta('b_cost', 0, None, None, 0) * SM_COST_SCALED)) + `0.0`), 3:(((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED)) + (((Beta('mu_existing', 1, 1, 10, 0) - `1.0`) * ((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED))) + (((`1.0` / Beta('mu_existing', 1, 1, 10, 0)) - `1.0`) * log(ConditionalSum((TRAIN_AV_SP != `0.0`): exp((Beta('mu_existing', 1, 1, 10, 0) * ((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED)))), (CAR_AV_SP != `0.0`): exp((Beta('mu_existing', 1, 1, 10, 0) * ((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED))))))))))av=(1:TRAIN_AV_SP, 2:SM_AV, 3:CAR_AV_SP) .. GENERATED FROM PYTHON SOURCE LINES 112-113 Iterator. .. GENERATED FROM PYTHON SOURCE LINES 113-116 .. code-block:: Python for specification in model_catalog: print(specification) .. rst-class:: sphx-glr-script-out .. code-block:: none NamedExpression(name='logit', expression=LogLogit[choice=CHOICE]U=(1:((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED)), 2:((Beta('b_time', 0, None, None, 0) * SM_TT_SCALED) + (Beta('b_cost', 0, None, None, 0) * SM_COST_SCALED)), 3:((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED)))av=(1:TRAIN_AV_SP, 2:SM_AV, 3:CAR_AV_SP)) NamedExpression(name='nested', expression=LogLogit[choice=CHOICE]U=(1:(((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED)) + (((Beta('mu_existing', 1, 1, 10, 0) - `1.0`) * ((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED))) + (((`1.0` / Beta('mu_existing', 1, 1, 10, 0)) - `1.0`) * log(ConditionalSum((TRAIN_AV_SP != `0.0`): exp((Beta('mu_existing', 1, 1, 10, 0) * ((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED)))), (CAR_AV_SP != `0.0`): exp((Beta('mu_existing', 1, 1, 10, 0) * ((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED))))))))), 2:(((Beta('b_time', 0, None, None, 0) * SM_TT_SCALED) + (Beta('b_cost', 0, None, None, 0) * SM_COST_SCALED)) + `0.0`), 3:(((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED)) + (((Beta('mu_existing', 1, 1, 10, 0) - `1.0`) * ((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED))) + (((`1.0` / Beta('mu_existing', 1, 1, 10, 0)) - `1.0`) * log(ConditionalSum((TRAIN_AV_SP != `0.0`): exp((Beta('mu_existing', 1, 1, 10, 0) * ((Beta('asc_train', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * TRAIN_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * TRAIN_COST_SCALED)))), (CAR_AV_SP != `0.0`): exp((Beta('mu_existing', 1, 1, 10, 0) * ((Beta('asc_car', 0, None, None, 0) + (Beta('b_time', 0, None, None, 0) * CAR_TT_SCALED)) + (Beta('b_cost', 0, None, None, 0) * CAR_CO_SCALED))))))))))av=(1:TRAIN_AV_SP, 2:SM_AV, 3:CAR_AV_SP)) .. GENERATED FROM PYTHON SOURCE LINES 117-118 All configurations. .. GENERATED FROM PYTHON SOURCE LINES 118-120 .. code-block:: Python print_all_configurations(model_catalog) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 2 configurations model_catalog:logit model_catalog:nested .. GENERATED FROM PYTHON SOURCE LINES 121-134 .. code-block:: Python lambda_travel_time = Beta('lambda_travel_time', 1, -10, 10, 0) linear_train_tt = TRAIN_TT boxcox_train_tt = boxcox(TRAIN_TT, lambda_travel_time) squared_train_tt = TRAIN_TT * TRAIN_TT train_tt_catalog = Catalog.from_dict( catalog_name='train_tt_catalog', dict_of_expressions={ 'linear': linear_train_tt, 'boxcox': boxcox_train_tt, 'squared': squared_train_tt, }, ) .. GENERATED FROM PYTHON SOURCE LINES 135-136 Define a utility function involving the catalog. .. GENERATED FROM PYTHON SOURCE LINES 136-140 .. code-block:: Python asc_train = Beta('ASC_TRAIN', 0, None, None, 0) b_time = Beta('B_TIME', 0, None, 0, 0) v_train_catalog = asc_train + b_time * train_tt_catalog .. GENERATED FROM PYTHON SOURCE LINES 141-143 .. code-block:: Python print_all_configurations(v_train_catalog) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 3 configurations train_tt_catalog:boxcox train_tt_catalog:linear train_tt_catalog:squared .. GENERATED FROM PYTHON SOURCE LINES 144-145 Unsynchronized catalogs .. GENERATED FROM PYTHON SOURCE LINES 145-157 .. code-block:: Python linear_car_tt = CAR_TT boxcox_car_tt = boxcox(CAR_TT, lambda_travel_time) squared_car_tt = CAR_TT * CAR_TT car_tt_catalog = Catalog.from_dict( catalog_name='car_tt_catalog', dict_of_expressions={ 'linear': linear_car_tt, 'boxcox': boxcox_car_tt, 'squared': squared_car_tt, }, ) .. GENERATED FROM PYTHON SOURCE LINES 158-159 Create a dummy expression with the two catalogs. .. GENERATED FROM PYTHON SOURCE LINES 159-161 .. code-block:: Python dummy_expression = train_tt_catalog + car_tt_catalog .. GENERATED FROM PYTHON SOURCE LINES 162-164 .. code-block:: Python print_all_configurations(dummy_expression) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 9 configurations car_tt_catalog:squared;train_tt_catalog:boxcox car_tt_catalog:linear;train_tt_catalog:linear car_tt_catalog:squared;train_tt_catalog:linear car_tt_catalog:squared;train_tt_catalog:squared car_tt_catalog:boxcox;train_tt_catalog:boxcox car_tt_catalog:boxcox;train_tt_catalog:linear car_tt_catalog:linear;train_tt_catalog:boxcox car_tt_catalog:linear;train_tt_catalog:squared car_tt_catalog:boxcox;train_tt_catalog:squared .. GENERATED FROM PYTHON SOURCE LINES 165-166 Synchronized catalogs. .. GENERATED FROM PYTHON SOURCE LINES 166-179 .. code-block:: Python linear_car_tt = CAR_TT boxcox_car_tt = boxcox(CAR_TT, lambda_travel_time) squared_car_tt = CAR_TT * CAR_TT car_tt_catalog = Catalog.from_dict( catalog_name='car_tt_catalog', dict_of_expressions={ 'linear': linear_car_tt, 'boxcox': boxcox_car_tt, 'squared': squared_car_tt, }, controlled_by=train_tt_catalog.controlled_by, ) .. GENERATED FROM PYTHON SOURCE LINES 180-181 Create a dummy expression with the two catalogs. .. GENERATED FROM PYTHON SOURCE LINES 181-183 .. code-block:: Python dummy_expression = train_tt_catalog + car_tt_catalog .. GENERATED FROM PYTHON SOURCE LINES 184-186 .. code-block:: Python print_all_configurations(dummy_expression) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 3 configurations train_tt_catalog:boxcox train_tt_catalog:linear train_tt_catalog:squared .. GENERATED FROM PYTHON SOURCE LINES 187-188 Alternative specific specification. .. GENERATED FROM PYTHON SOURCE LINES 188-195 .. code-block:: Python (b_time_catalog_dict, b_cost_catalog_dict) = generic_alt_specific_catalogs( generic_name='coefficients', beta_parameters=[b_time, b_cost], alternatives=('train', 'car'), ) .. GENERATED FROM PYTHON SOURCE LINES 196-197 Create utility functions involving those catalogs. .. GENERATED FROM PYTHON SOURCE LINES 197-204 .. code-block:: Python v_train_catalog = ( b_time_catalog_dict['train'] * TRAIN_TT + b_cost_catalog_dict['train'] * TRAIN_COST ) v_car_catalog = ( b_time_catalog_dict['car'] * CAR_TT + b_cost_catalog_dict['car'] * CAR_CO ) .. GENERATED FROM PYTHON SOURCE LINES 205-206 Create a dummy expression involving the utility functions. .. GENERATED FROM PYTHON SOURCE LINES 206-208 .. code-block:: Python dummy_expression = v_train_catalog + v_car_catalog .. GENERATED FROM PYTHON SOURCE LINES 209-211 .. code-block:: Python print_all_configurations(dummy_expression) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 2 configurations coefficients_gen_altspec:altspec coefficients_gen_altspec:generic .. GENERATED FROM PYTHON SOURCE LINES 212-213 Alternative specific - not synchronized. .. GENERATED FROM PYTHON SOURCE LINES 213-225 .. code-block:: Python (b_time_catalog_dict,) = generic_alt_specific_catalogs( generic_name='time_coefficient', beta_parameters=[b_time], alternatives=('train', 'car'), ) (b_cost_catalog_dict,) = generic_alt_specific_catalogs( generic_name='cost_coefficient', beta_parameters=[b_cost], alternatives=('train', 'car'), ) .. GENERATED FROM PYTHON SOURCE LINES 226-227 Create utility functions involving those catalogs. .. GENERATED FROM PYTHON SOURCE LINES 227-234 .. code-block:: Python v_train_catalog = ( b_time_catalog_dict['train'] * TRAIN_TT + b_cost_catalog_dict['train'] * TRAIN_COST ) v_car_catalog = ( b_time_catalog_dict['car'] * CAR_TT + b_cost_catalog_dict['car'] * CAR_CO ) .. GENERATED FROM PYTHON SOURCE LINES 235-236 Create a dummy expression involving the utility functions. .. GENERATED FROM PYTHON SOURCE LINES 236-238 .. code-block:: Python dummy_expression = v_train_catalog + v_car_catalog .. GENERATED FROM PYTHON SOURCE LINES 239-241 .. code-block:: Python print_all_configurations(dummy_expression) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 4 configurations cost_coefficient_gen_altspec:generic;time_coefficient_gen_altspec:generic cost_coefficient_gen_altspec:generic;time_coefficient_gen_altspec:altspec cost_coefficient_gen_altspec:altspec;time_coefficient_gen_altspec:altspec cost_coefficient_gen_altspec:altspec;time_coefficient_gen_altspec:generic .. GENERATED FROM PYTHON SOURCE LINES 242-243 Read the data .. GENERATED FROM PYTHON SOURCE LINES 243-245 .. code-block:: Python database = read_data() .. GENERATED FROM PYTHON SOURCE LINES 246-247 Segmentation .. GENERATED FROM PYTHON SOURCE LINES 249-251 We consider two trip purposes: `commuters` and anything else. We need to define a binary variable first. .. GENERATED FROM PYTHON SOURCE LINES 251-253 .. code-block:: Python database.dataframe['COMMUTERS'] = np.where(database.dataframe['PURPOSE'] == 1, 1, 0) .. GENERATED FROM PYTHON SOURCE LINES 254-255 Segmentation on trip purpose. .. GENERATED FROM PYTHON SOURCE LINES 255-261 .. code-block:: Python segmentation_purpose = database.generate_segmentation( variable='COMMUTERS', mapping={0: 'non_commuters', 1: 'commuters'}, reference='non_commuters', ) .. GENERATED FROM PYTHON SOURCE LINES 262-263 Segmentation on luggage. .. GENERATED FROM PYTHON SOURCE LINES 263-269 .. code-block:: Python segmentation_luggage = database.generate_segmentation( variable='LUGGAGE', mapping={0: 'no_lugg', 1: 'one_lugg', 3: 'several_lugg'}, reference='no_lugg', ) .. GENERATED FROM PYTHON SOURCE LINES 270-272 Catalog of segmented alternative specific constants, allows a maximum of two segmentations. .. GENERATED FROM PYTHON SOURCE LINES 272-282 .. code-block:: Python asc_train_catalog, asc_car_catalog = segmentation_catalogs( generic_name='asc', beta_parameters=[asc_train, asc_car], potential_segmentations=( segmentation_purpose, segmentation_luggage, ), maximum_number=2, ) .. GENERATED FROM PYTHON SOURCE LINES 283-284 Create a dummy expression. .. GENERATED FROM PYTHON SOURCE LINES 284-286 .. code-block:: Python dummy_expression = asc_train_catalog + asc_car_catalog .. GENERATED FROM PYTHON SOURCE LINES 287-289 .. code-block:: Python print_all_configurations(dummy_expression) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 4 configurations asc:COMMUTERS asc:COMMUTERS-LUGGAGE asc:LUGGAGE asc:no_seg .. GENERATED FROM PYTHON SOURCE LINES 290-292 Catalog of segmented alternative specific constants, allows a maximum of one segmentation. .. GENERATED FROM PYTHON SOURCE LINES 292-302 .. code-block:: Python asc_train_catalog, asc_car_catalog = segmentation_catalogs( generic_name='asc', beta_parameters=[asc_train, asc_car], potential_segmentations=( segmentation_purpose, segmentation_luggage, ), maximum_number=1, ) .. GENERATED FROM PYTHON SOURCE LINES 303-304 Create a dummy expression. .. GENERATED FROM PYTHON SOURCE LINES 304-306 .. code-block:: Python dummy_expression = asc_train_catalog + asc_car_catalog .. GENERATED FROM PYTHON SOURCE LINES 307-309 .. code-block:: Python print_all_configurations(dummy_expression) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 3 configurations asc:COMMUTERS asc:LUGGAGE asc:no_seg .. GENERATED FROM PYTHON SOURCE LINES 310-312 Segmentation and alternative specific Maximum one segmentation. .. GENERATED FROM PYTHON SOURCE LINES 312-323 .. code-block:: Python (b_time_catalog_dict,) = generic_alt_specific_catalogs( generic_name='b_time', beta_parameters=[b_time], alternatives=('train', 'car'), potential_segmentations=( segmentation_purpose, segmentation_luggage, ), maximum_number=1, ) .. GENERATED FROM PYTHON SOURCE LINES 324-326 .. code-block:: Python print_all_configurations(b_time_catalog_dict['train']) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 6 configurations b_time:no_seg;b_time_gen_altspec:generic b_time:LUGGAGE;b_time_gen_altspec:generic b_time:COMMUTERS;b_time_gen_altspec:generic b_time:LUGGAGE;b_time_gen_altspec:altspec b_time:no_seg;b_time_gen_altspec:altspec b_time:COMMUTERS;b_time_gen_altspec:altspec .. GENERATED FROM PYTHON SOURCE LINES 327-328 Maximum two segmentations. .. GENERATED FROM PYTHON SOURCE LINES 328-339 .. code-block:: Python (b_time_catalog_dict,) = generic_alt_specific_catalogs( generic_name='b_time', beta_parameters=[b_time], alternatives=('train', 'car'), potential_segmentations=( segmentation_purpose, segmentation_luggage, ), maximum_number=2, ) .. GENERATED FROM PYTHON SOURCE LINES 340-341 .. code-block:: Python print_all_configurations(b_time_catalog_dict['train']) .. rst-class:: sphx-glr-script-out .. code-block:: none Total: 8 configurations b_time:no_seg;b_time_gen_altspec:generic b_time:COMMUTERS-LUGGAGE;b_time_gen_altspec:altspec b_time:LUGGAGE;b_time_gen_altspec:generic b_time:COMMUTERS;b_time_gen_altspec:generic b_time:COMMUTERS-LUGGAGE;b_time_gen_altspec:generic b_time:LUGGAGE;b_time_gen_altspec:altspec b_time:no_seg;b_time_gen_altspec:altspec b_time:COMMUTERS;b_time_gen_altspec:altspec .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.241 seconds) .. _sphx_glr_download_auto_examples_assisted_plot_simple_example.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_simple_example.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_simple_example.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_simple_example.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_