numbbo / coco

Numerical Black-Box Optimization Benchmarking Framework
https://numbbo.github.io/coco
Other
263 stars 91 forks source link

[Feature request] Runtime distribution aggregated on a chosen set of functions #2317

Closed nikohansen closed 2 months ago

nikohansen commented 4 months ago

We should have a recipe for how to create/show runtime distributions for a user-defined subset of the functions of a testbed. For example, all graphs and html pages could be created from an initially reduced/filtered data set list.

Usecases:

This could be implemented as another filter (like the current Testbed.filter method) which reads a global option defining the subset, for example a Testbed.user_filter method which reads a cocopp.genericsettings.function_ids_filter variable where negative values remove the respective function.

nikohansen commented 3 months ago

This code is a start to get a single such figure

import cocopp
cocopp.compall.pprldmany.close_figure = False
%matplotlib

funcIds_to_remove = [5]
dimension_to_plot = 20

ddsl = cocopp.load2('bbob/2022/.*a.i.o.*')

for dim in ddsl:
    for alg in ddsl[dim]:
        for i in reversed(range(len(ddsl[dim][alg]))):
            dsl = ddsl[dim][alg]
            ds = dsl[i]
            if ds.funcId in funcIds_to_remove:
                dsl.remove(ds)

cocopp.compall.pprldmany.main(ddsl[dimension_to_plot])
nikohansen commented 3 months ago

This is going to be available, for example, to show/select the "essentially unimodal" bbob functions:

import cocopp

cocopp.genericsettings.filter_data_condition = (
        lambda ds: ds.funcId in [1, 2,] + list(range(5, 15)))

dsl = cocopp.main('bbob/2022/.*a.i.o.*')

and

import cocopp

dsl = cocopp.load2('bbob/2022/.*a.i.o.*',
                   keep=lambda ds: ds.funcId in [1, 2,] + list(range(5, 15))