class documentation

class BestAlgSet(DataSet):

Constructor: BestAlgSet(dict_alg, algId)

View In Hierarchy

Unit element of best algorithm data set.

Here unit element means for one function and one dimension. This class is derived from DataSet but it does not inherit from it.

Class attributes:
  • funcId -- function Id (integer)
  • dim -- dimension (integer)
  • comment -- comment for the setting (string)
  • algId -- algorithm name (string)
  • evals -- collected data aligned by function values (array)
  • maxevals -- maximum number of function evaluations (array)

evals and funvals are arrays of data collected from N data sets. Both have the same format: zero-th column is the value on which the data of a row is aligned, the N subsequent columns are either the numbers of function evaluations for evals or function values for funvals.

Known bug: algorithms where the ERT is NaN or Inf are not taken into account!?

Method __eq__ Compare indexEntry instances.
Method __init__ Instantiate one best algorithm data set with name algId.
Method __ne__ Undocumented
Method __repr__ Undocumented
Method createDictInstance Returns a dictionary of the instances
Method detERT Determine the expected running time to reach target values.
Method detEvals Determine the number of evaluations to reach target values.
Method get_success_ratio Undocumented
Method pickle Save instance to a pickle file.
Instance Variable algbestfinalfunvals Undocumented
Instance Variable algId Undocumented
Instance Variable algs Undocumented
Instance Variable best_algorithm_data Undocumented
Instance Variable bestfinalfunvals Undocumented
Instance Variable comment Undocumented
Instance Variable dim Undocumented
Instance Variable finalfunvals Undocumented
Instance Variable funcId Undocumented
Instance Variable funvalsnofail Undocumented
Instance Variable instances Undocumented
Instance Variable pickleFile Undocumented
Instance Variable precision Undocumented
Instance Variable success_ratio Undocumented
Instance Variable suite Undocumented
Instance Variable used_algorithms Undocumented
Instance Variable _ert Undocumented
Instance Variable _evals _evals are the central data and later accessed via the evals property. Each line _evals[i] has a (target) function value in _evals[i][0] and the function evaluation for which this target was reached the first time in trials 1,...
Instance Variable _maxevals Undocumented
Instance Variable _target Undocumented

Inherited from DataSet:

Method bootstrap_sample_size return minimum size not smaller than sample_size such that modulo self.nbRuns() == 0
Method computeERTfromEvals Sets the attributes ert and target from the attribute evals.
Method consistency_check checks consistency of data set according to - number of instances - instances used
Method createDictInstanceCount Returns a dictionary of the instances and their count.
Method detAverageEvals Determine the average number of f-evals for each target in targets list.
Method detEvals_by_instance return result of detEvals for each instance individually
Method detSuccesses return the number of successful runs for each target.
Method detSuccessRates return a np.array with the success rate for each target in targets, easiest target first.
Method evals_with_simulated_restarts Return a len(targets) list of samplesize "simulated runtimes"
Method generateRLData Determine the running lengths for reaching the target values.
Method get_data_format Undocumented
Method info print text info to stdout
Method info_str return print info as string
Method instance_index_lists return OrderedDict of index lists for each instance.
Method isBiobjective Undocumented
Method median_evals return median for each row in self.evals, unsuccessful runs count.
Method mMaxEvals Returns the maximum number of function evaluations over all runs (trials), obsolete and replaced by attribute max_eval
Method nbRuns Returns the number of runs depending on genericsettings.balance_instances.
Method plot plot all data from evals attribute and the median.
Method plot_funvals plot data of funvals attribute, versatile
Method splitByTrials Splits the post-processed data arrays by trials.
Method successes_by_instance return OrderedDict with number of successes for each instance
Instance Variable dataFiles Undocumented
Instance Variable funvals Undocumented
Instance Variable indexFiles Undocumented
Instance Variable instancenumbers Undocumented
Instance Variable isFinalized Undocumented
Instance Variable readfinalFminusFtarget Undocumented
Instance Variable readmaxevals maxevals as read from the info files
Instance Variable reference_values Undocumented
Property budget_effective_estimates return OrderedDict of sum(maxevals) / max(1, #successes)
Property ert expected runtimes for the targets in target.
Property evals evals contains the central data, number of evaluations.
Property evals_appended Is this abandoned?
Property evals_are_appended return True if self.evals_appended consist of appended trials (same instances are appended)
Property instance_multipliers number of repetitions per instance to balance a skewed instance distribution.
Property instancenumbers_balanced return instancenumbers extended with balancing_instancenumbers
Property max_eval maximum number of function evaluations over all runs (trials),
Property maxevals maxevals per instance data, i.e. the columns of evals[:, 1:].
Property maxfgevals maximum of the weighted f+g sum per instance.
Property nbRuns_raw Undocumented
Property number_of_constraints number of constraints of the function/problem the DataSet is based upon.
Property suite_name Returns a string, with the name of the DataSet's underlying test suite.
Property target target values (np.array) corresponding to ert (which all have finite values)
Property trial_count_by_instance return Counter dict with number of trials (actually) done for each instance
Static Method _largest_finite_index return i such that isfinite(ar[i]) and not isfinite(ar[i+1]),
Method __parseHeader Extract data from a header line in an index entry.
Method _argsort return index array for a sorted order of trials.
Method _balanced_evals_row append evaluations to evals_row to achieve a balanced instance distribution.
Method _complement_data insert a line for each target value, never used (detEvals(targets) does the job on the fly)
Method _cut_data attributes target, evals, and ert are truncated to target values not much smaller than defined in attribute precision (typically 1e-8). Attribute maxevals is recomputed for columns that reach the final target precision...
Method _data_differ return a list of targets for which ds differs from self
Method _detEvals2 Determine the number of evaluations to reach target values.
Method _detMaxEvals computes for each data column of _evals the (maximal) evaluation until final_target was reached, or self.maxevals otherwise.
Method _evals_appended_compute create evals-array with appended instances.
Method _evals_with_simulated_restarts return simulated runtimes for each 1D-array in evals_list.
Method _number_of_better_runs return the number of self.evals(target) that are smaller
Method _old_plot plot data from evals attribute.
Method _update_evals_balanced update attribute _evals_balanced if necessary.
Method _WIP_number_of_better_runs return the number of self.evals([target]) that are better
Class Variable _attributes Undocumented
Instance Variable _ert_nb_of_data Undocumented
Instance Variable _evals_appended Undocumented
Instance Variable _evals_balanced Undocumented
Instance Variable _evals_balanced_raw_data_columns Undocumented
Instance Variable _extra_attr Undocumented
Instance Variable _lasttdatfilelines Undocumented
Instance Variable _maxevals_appended Undocumented
Property _budget_estimates return OrderedDict of sum(maxevals) for each (raw data) instance.
Property _instance_repetitions return the number of runs that repeated a previous instance.
Property _need_balancing return True of gs.balance_instances and self.instance_multipliers are >1
def __eq__(self, other):

Compare indexEntry instances.

def __init__(self, dict_alg, algId='Virtual Best Algorithm'):

Instantiate one best algorithm data set with name algId.

Parameters
dict_algdictionary of datasets, keys are algorithm names, values are 1-element DataSetList.
algIdname of the to-be-constructed algorithm as string
def __ne__(self, other):

Undocumented

def __repr__(self):

Undocumented

def createDictInstance(self):

Returns a dictionary of the instances

The key is the instance id, the value is a list of index.

def detERT(self, targets):

Determine the expected running time to reach target values.

Parameters
targetsUndocumented
list targetstarget function values of interest
Returns
list of expected running times corresponding to the targets.
def detEvals(self, targets):

Determine the number of evaluations to reach target values.

Parameters
targetsUndocumented
seq targetstarget precisions
Returns
list of arrays each corresponding to one value in targets and the list of the corresponding algorithms
def get_success_ratio(self, target):

Undocumented

def pickle(self, outputdir=None):

Save instance to a pickle file.

Saves the instance to a pickle file. If not specified by argument outputdir, the location of the pickle is given by the location of the first index file associated.

algbestfinalfunvals =

Undocumented

algId =

Undocumented

algs =

Undocumented

best_algorithm_data =

Undocumented

bestfinalfunvals =

Undocumented

comment =

Undocumented

dim =

Undocumented

finalfunvals =

Undocumented

funcId =

Undocumented

funvalsnofail =

Undocumented

instances =

Undocumented

pickleFile =

Undocumented

precision =

Undocumented

success_ratio =

Undocumented

suite =

Undocumented

used_algorithms =

Undocumented

_ert =

Undocumented

_evals =

_evals are the central data and later accessed via the evals property. Each line _evals[i] has a (target) function value in _evals[i][0] and the function evaluation for which this target was reached the first time in trials 1,... in _evals[i][1:].

_maxevals =

Undocumented

_target =

Undocumented