maximum_number_parameters in assisted specification

20 views
Skip to first unread message

Gabriel Nova Sepulveda

unread,
Dec 5, 2025, 4:47:03 AM (14 days ago) Dec 5
to Biogeme
Hi Michel, 

I have been working with the assisted specification procedure (Bierlaire and Ortelli, 2023) on the Swissmetro data. Following your example, I was able to get the method running and to increase maximum_number_catalog_expressionsvia the biogeme.toml file. However, I have not been able to change the limit on maximum_number_parameters beyond the default value of 50 used in the assisted specification step.

See below how I defined the Biogeme object and modify the toml file:

dummy_expression = v1 + v2 + v3
log_probability = loglogit(v, av, choice)
model_catalog = Catalog.from_dict(catalog_name='model_catalog', dict_of_expressions={'logit': log_probability},)

default_toml_file_name = 'biogeme.toml'
with open(default_toml_file_name, 'r') as file:
lines = file.readlines()

for i, line in enumerate(lines):
if 'maximum_number_parameters' in line:
lines[i] = 'maximum_number_parameters = 200\n'
for i, line in enumerate(lines):
if 'maximum_number_catalog_expressions' in line:
lines[i] = 'maximum_number_catalog_expressions = 5000\n'

with open(default_toml_file_name, 'w') as file:
file.writelines(lines)

the_biogeme = BIOGEME(database, model_catalog, generate_html=False, generate_yaml=False)
the_biogeme.model_name = 'candidates'

print(f'maximum_number_catalog_expressions: {the_biogeme.maximum_number_catalog_expressions}')
print(f'maximum_number_parameters: {the_biogeme.maximum_number_parameters}')


When I ran the script, I got the following:


python c_assisted_specification.py

maximum_number_catalog_expressions: 5000

maximum_number_parameters: 200

Full assisted on Swissmetro 

Total configurations: 21233664

Biogeme parameters read from biogeme.toml. 

Unable to read file assisted_full.pareto. Pareto set empty. 

Biogeme parameters read from biogeme.toml. 


Model with 6 unknown parameters [max: 50] 

*** Estimate candidates_000000 

As the model is not too complex, we activate the calculation of second derivatives. 

default_specification=alt1_1_catalog:linear;alt1_2_catalog:linear;alt1_3_catalog:linear;alt2_4_catalog:linear;asc:no_seg;b_cost:no_seg;b_cost_gen_altspec:generic;b_headway:no_seg;b_headway_gen_altspec:generic;b_seat:no_seg;b_time:no_seg;b_time_gen_altspec:generic;model_catalog:logit 

The number of possible specifications [21233664] exceeds the maximum number [5000]. A heuristic algorithm is applied. 

*** VNS ***


Apart from that, I also modified manually the parameter in the toml file. while the BIOGEME reports maximum_number_parameters = 200, the assisted specification still seems to enforce a limit of 50 ([max: 50] in the log). 

Could you guide me on the correct way to increase the parameter limit?


Many thanks in advance,

Gabriel Nova



Michel Bierlaire

unread,
Dec 8, 2025, 8:57:27 AM (11 days ago) Dec 8
to g.nov...@gmail.com, Michel Bierlaire, Biogeme

It looks like a small bug. I'll investigate. Meanwhile, try to set the logger to DEBUG. It will print the value that is used before the estimation.

See file catalog/specification.py

You can use the brute-force way and hardcode the value you like at the place...
> --
> You received this message because you are subscribed to the Google Groups "Biogeme" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/biogeme/87e25655-77a7-41c8-82e2-867e048e1b34n%40googlegroups.com.

Michel Bierlaire
Transport and Mobility Laboratory
School of Architecture, Civil and Environmental Engineering
EPFL - Ecole Polytechnique Fédérale de Lausanne
http://transp-or.epfl.ch
http://people.epfl.ch/michel.bierlaire

Gabriel Nova Sepulveda

unread,
Dec 9, 2025, 4:00:17 AM (10 days ago) Dec 9
to Biogeme
I defined the max number of parameters in catalog/specification.py and worked

self.maximum_number_parameters = 200
#self.maximum_number_parameters = (
# get_default_value(
# name='maximum_number_parameters', section='AssistedSpecification'
# )
# if biogeme_parameters is None
# else biogeme_parameters.get_value(
# name='maximum_number_parameters', section='AssistedSpecification'
# )
#)

Reply all
Reply to author
Forward
0 new messages