cocopp.cococommands module documentationcocopp
Depreciated (`cocopp` itself is to be used from Jupyter or IPython):
Module for using COCO from the (i)Python interpreter.
The main data structures used in COCO are :py:class:`DataSet`, which
corresponds to data of one algorithm on one problem, and
:py:class:`DataSetList`, which is for collections of :py:class:`DataSet`
instances. Both classes are implemented in :py:mod:`cocopp.pproc`.
Examples:
* Start by importing :py:mod:`cocopp`::
>>> import cocopp
>>> cocopp.genericsettings.verbose = False # ensure to make below doctests work
>>> def print_(*args, **kwargs): pass
>>> cocopp.archives.bbob._print = print_ # avoid download notification
* Load a data set, assign to variable :py:data:`ds`::
>>> path = cocopp.archives.bbob.get(4)
>>> print('ESC'); dsl = cocopp.load(path) # a dataset list # doctest:+ELLIPSIS
ESC...
>>> ds = dsl[0]
* Get some information on a :py:class:`DataSetList` instance::
>>> print(dsl) # doctest:+ELLIPSIS
[DataSet(BIPOP-CMA-ES on f1 2-D), DataSet(BIPOP-CMA-ES on f2 2-D),...
>>> dsl.info()
144 data set(s)
Algorithm(s): BIPOP-CMA-ES
24 Functions with IDs 1-24
Dimension(s): 2, 3, 5, 10, 20, 40
Max evals: [1625595, 2349823, 3114271, 5884514, 12102699, 36849608]
* Get some information on a :py:class:`DataSet` instance::
>>> print(ds)
DataSet(BIPOP-CMA-ES on f1 2-D)
>>> ds.info()
Algorithm: BIPOP-CMA-ES
Function ID: 1
Dimension DIM = 2
Number of trials: 15
Final target Df: 1e-08
min / max number of evals per trial: 224 / 333
evals/DIM: best 15% 50% 85% max | aRT/DIM nsucc
---Df---|-----------------------------------------|----------------
1.0e+03 | 0 0 0 0 0 | 0.5 15
1.0e+01 | 0 0 2 8 10 | 2.9 15
1.0e-01 | 8 13 22 38 52 | 24.2 15
1.0e-03 | 34 48 56 74 77 | 58.2 15
1.0e-05 | 64 70 89 100 102 | 86.1 15
1.0e-08 | 112 116 128 150 166 | 130.9 15
| Function | load | Create a :py:class:`DataSetList` instance from a file or folder. |
| Function | info | Display more info on an instance of DatasetList. |
| Function | pickle | Pickle a DataSetList. |
| Function | systeminfo | Display information on the system. |