cocopp.ppfigdim
module documentationcocopp
Generate performance scaling figures. The figures show the scaling of the performance in terms of aRT w.r.t. dimensionality on a log-log scale. On the y-axis, data is represented as a number of function evaluations divided by dimension, this is in order to compare at a glance with a linear scaling for which aRT is proportional to the dimension and would therefore be represented by a horizontal line in the figure. Crosses (+) give the median number of function evaluations of successful trials divided by dimension for the smallest *reached* target function value. Numbers indicate the number of successful runs for the smallest *reached* target. If the smallest target function value (1e-8) is not reached for a given dimension, crosses (x) give the average number of overall conducted function evaluations divided by the dimension. Horizontal lines indicate linear scaling with the dimension, additional grid lines show quadratic and cubic scaling. The thick light line with diamond markers shows the results of the specified reference algorithm for df = 1e-8 or a runlength-based target (if in the expensive/runlength-based targets setting). **Example** .. plot:: :width: 50% import urllib import tarfile import glob from pylab import * import cocopp # Collect and unarchive data (3.4MB) dataurl = 'http://coco.lri.fr/BBOB2009/pythondata/BIPOP-CMA-ES.tar.gz' filename, headers = urllib.urlretrieve(dataurl) archivefile = tarfile.open(filename) archivefile.extractall() # Scaling figure ds = cocopp.load(glob.glob('BBOB2009pythondata/BIPOP-CMA-ES/ppdata_f002_*.pickle')) figure() cocopp.ppfigdim.plot(ds) cocopp.ppfigdim.beautify() cocopp.ppfigdim.plot_previous_algorithms(2, False) # plot BBOB 2009 best algorithm on fun 2
Function | scaling_figure_caption | Provides a figure caption with the help of captions.py for replacing common texts, abbreviations, etc. |
Function | beautify | Customize figure presentation. |
Function | generateData | Computes an array of results to be plotted. |
Function | plot_a_bar | plot/draw a notched error bar, x is the x-position, y[0,1,2] are lower, median and upper percentile respectively. |
Function | plot | From a DataSetList, plot a figure of aRT/dim vs dim. |
Function | plot_previous_algorithms | Add graph of the reference algorithm, specified in testbedsettings.current_testbed using the last, most difficult target in target. |
Function | main | From a DataSetList, returns a convergence and aRT/dim figure vs dim. |
Customize figure presentation.
Uses information from the appropriate benchmark short infos file for figure title.
Returns | (ert, success rate, number of success, total number of function evaluations, median of successful runs). |
plot/draw a notched error bar, x is the x-position, y[0,1,2] are lower, median and upper percentile respectively.
hold(True) to see everything.
TODO: with linewidth=0, inf is not visible
From a DataSetList, plot a figure of aRT/dim vs dim.
There will be one set of graphs per function represented in the input data sets. Most usually the data sets of different functions will be represented separately.
Parameters | DataSetList dsList | data sets |
seq valuesOfInterest | target precisions via class TargetValues, there might be as many graphs as there are elements in this input. Can be different for each function (a dictionary indexed by ifun). | |
Returns | handles |
From a DataSetList, returns a convergence and aRT/dim figure vs dim.
If available, uses data of a reference algorithm as specified in :py:genericsettings.py.
Parameters | DataSetList dsList | data sets |
seq _valuesOfInterest | target precisions, either as list or as pproc.TargetValues class instance. There will be as many graphs as there are elements in this input. | |
string outputdir | output directory |