class documentation

a class instance call returns f-target values based on reference runlengths:

>>> import cocopp
>>> # make sure to use the right `bbob` test suite for the test below:
>>> cocopp.genericsettings.isNoisy = False
>>> cocopp.genericsettings.isNoiseFree = False
>>> cocopp.config.config('bbob')
>>> targets = cocopp.pproc.RunlengthBasedTargetValues([0.5, 1.2, 3, 10, 50])  # by default times_dimension==True
>>> # make also sure to have loaded the corresponding reference algo
>>> # from BBOB-2009:
>>> targets.reference_data = 'testbedsettings'
>>> t = targets(fun_dim=(1, 20)) # doctest:+ELLIPSIS
Loading best algorithm data from ...
>>> assert 6.30957345e+01 <= t[0] <= 6.30957346e+01
>>> assert t[-1] == 1.00000000e-08

returns a list of target f-values for F1 in 20-D, based on the ERT values [0.5,...,50].

Details: The computation starts from the smallest budget and the resulting f-target must always be at least a factor of force_different_targets_factor smaller than the previous one. If the smallest_target is superseded, the log values are linearly rescaled such that the easiest found target remains the same and the smallest target becomes smallest_target.

TODO: see compall/determineFtarget2.FunTarget

Static Method cast idempotent cast to RunlengthBasedTargetValues class type
Method __call__ Get all target values for the respective function and dimension and reference ERT values (passed during initialization). fun_dim is a tuple (fun_nb, dimension) like (1, 20) for the 20-D sphere.
Method __init__ calling the class instance returns run-length based target values based on the reference data, individually computed for a given (funcId, dimension).
Method __len__ Undocumented
Method initialize lazy initialization to prevent slow import
Method label return i-th target value as string
Method label_name Undocumented
Method labels target values as a list of str
Method loglabel decimals is used for round
Instance Variable force_different_targets_factor Undocumented
Instance Variable initialized Undocumented
Instance Variable reference_algorithm Undocumented
Instance Variable reference_data Undocumented
Instance Variable run_lengths Undocumented
Instance Variable smallest_target Undocumented
Instance Variable step_to_next_difficult_target Undocumented
Instance Variable target_discretization_factor Undocumented
Instance Variable times_dimension Undocumented
Instance Variable unique_target_values Undocumented
Method _generate_erts compute for all target values, starting with 1e-8, the ert value and store it in the reference_data_set attribute
Instance Variable _short_info Undocumented

Inherited from TargetValues:

Method loglabels log10 of the target values as a list of str
Instance Variable __dict__ Undocumented
Instance Variable target_values Undocumented
Property short_info Undocumented
Static Method _discretize return a "similar" list with targets in [10**i/5]
@staticmethod
def cast(run_lengths_or_class_instance, *args, **kwargs):

idempotent cast to RunlengthBasedTargetValues class type

def __call__(self, fun_dim=None, discretize=None):

Get all target values for the respective function and dimension and reference ERT values (passed during initialization). fun_dim is a tuple (fun_nb, dimension) like (1, 20) for the 20-D sphere.

if discretize all targets are in [10**i/5 for i in N], in case achieved via rounding on the log-scale.

Details: f_target = arg min_f { ERT_ref(f) > max(1, target_budget * dimension**times_dimension_flag) }, where f are the values of the DataSet target attribute. The next difficult target is chosen not smaller as target / 10**0.2.

Returned are the ERT for targets that, within the given budget, the reference algorithm just failed to achieve.

def __init__(self, run_lengths, reference_data='testbedsettings', smallest_target=1e-08, times_dimension=True, force_different_targets_factor=10**0.04, unique_target_values=False, step_to_next_difficult_target=10**0.2):

calling the class instance returns run-length based target values based on the reference data, individually computed for a given (funcId, dimension).

TODO: check use case where reference_data is a dictionary similar to bestalg.bestAlgorithmEntries with each key dim_fun a reference DataSet, computed by bestalg module or portfolio module.

dsList, sortedAlgs, dictAlg = pproc.processInputArgs(args) ref_data = refalg.generate(dictAlg) targets = RunlengthBasedTargetValues([1, 2, 4, 8], ref_data)
Parameters
run_lengthssequence of values.
reference_datacan be a string indicating the filename of a reference algorithm data set such as "refalgs/best2009-bbob.tar.gz" or a dictionary of best data sets (e.g. from bestalg.generate(...)) or a list of algorithm folder/data names (not thoroughly tested). If chosen as testbedsettings, the reference algorithm specified in testbedsettings.py will be used.
smallest_target
times_dimension
force_different_targets_factorgiven the target values are computed from the reference_data, enforces that all target values are different by at last forced_different_targets_factor if forced_different_targets_factor. Default 10**0.04 means that within the typical precision of 10**0.2 at most five consecutive targets can be identical.
unique_target_valuesUndocumented
step_to_next_difficult_targetthe next more difficult target (just) not reached within the target run length is chosen, where step_to_next_difficult_target defines "how much more difficult".
def __len__(self):

Undocumented

def initialize(self):

lazy initialization to prevent slow import

def label(self, i):

return i-th target value as string

def label_name(self):

Undocumented

def labels(self):

target values as a list of str

def loglabel(self, i, decimals=1):

decimals is used for round

force_different_targets_factor =

Undocumented

initialized: bool =

Undocumented

reference_algorithm =

Undocumented

reference_data =

Undocumented

run_lengths =

Undocumented

smallest_target =

Undocumented

step_to_next_difficult_target =

Undocumented

target_discretization_factor =

Undocumented

times_dimension =

Undocumented

unique_target_values =

Undocumented

def _generate_erts(self, ds, target_values):

compute for all target values, starting with 1e-8, the ert value and store it in the reference_data_set attribute

_short_info =

Undocumented