Skip to content

Commit

Permalink
Add yml documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasFehring committed Feb 5, 2024
1 parent 859a88d commit c964577
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions docs/source/usage/experiment_configuration_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The experiment configuration file is primarily used to define the database backe
Database Information
--------------------

The ``database`` section defines the database and its structure. It contains the ``provider`` of the database connection (either ``sqlite`` or ``mysql``). Furthermore, the name of the ``database`` has to be given. Additionally, there is a subsection called ``table``, which contains the name of the table, the optional :ref: `keyfields <keyfields>`, and the optional :ref: `resultfields <resultfields>`. The ``result_timestamps`` parameter is optional and can be set to ``True`` if the timestamps at which the results have been obtained should be stored in the database.
The ``Database`` section defines the database and its structure. It contains the ``provider`` of the database connection (either ``sqlite`` or ``mysql``). Furthermore, the name of the ``database`` has to be given. Additionally, there is a subsection called ``table``, which contains the name of the table, the optional :ref: `keyfields <keyfields>`, and the optional :ref: `resultfields <resultfields>`.


.. note::
Expand All @@ -72,41 +72,50 @@ Experiments are identified by ``keyfields``, hence, keyfields define the executi
.. code-block:: yml
keyfields:
<keyfield_name>:
type: <keyfield_datatype>
input_value:
type: NUMERIC
values: <keyfield_values>
...
For each keyfield,a type has to be defined (depending on the database provider). Additionally, the values have to be defined. This can be done either with a list of values, or a range of values. The range of values can be defined by ``start``, ``stop`` and the optional ``step`` size.
For each keyfield, a type has to be defined (supported types depent on the provided database). Additionally, the values have to be defined. This can be done either with a list of values, or a range of values. The range of values can be defined by ``start``, ``stop`` and the optional ``step`` size. In the above example, this would result in

.. code-block:: yml
keyfield_with_list:
type: VARCHAR(255)
values: ['iris']
seed:
type: int
values:
start: 2
stop: 7
step: 2
keyfields:
input_value:
type: NUMERIC
values:
start: 1
stop: 10
step: 1
for ranges and
.. code-block:: yml
keyfields:
input_value:
type: NUMERIC
values: [1, 2, 3, 4, 5, 6, 7, 8, 9]
.. _resultfields:
for lists.

Note that ranges are defined by their ``start``, their ``stop``, and the optional ``step`` size. The step size is optional and defaults to ``1``. The stop is not included in the range.


------------
Resultfields
------------

The results of the experiments will be stored in the database in the form of ``resultfields``. They are optional and are also contained in the `table` section of the experiment configuration file. The resultfields are defined in the following way:
The results of the experiments will be stored in the database in the form of ``resultfields``. They are optional and are also contained in the ``tabl`` section of the experiment configuration file. The resultfields are defined in the following way:

.. code-block:: yml
resultfields:
pipeline: LONGTEXT
train_f1: DECIMAL
Additionally, it is possible to store the timestamps at which the results have been obtatined in the database. This can be done by adding the following line to the experiment configuration file (Default is ``False``).
with the name of the resultfield, followed by its type.
Additionally, it is possible to store the timestamps at which the results have been obtained in the database. This can be done by adding the following line to the experiment configuration file (Default is ``False``).

.. code-block:: yml
Expand All @@ -125,7 +134,7 @@ Additionally, it is possible to store the timestamps at which the results have b
Logtables
---------

In addition to the functionality stated above, ``PyExperimenter`` also supports ``logtables`` thereby enabling the logging of information into separate tables. This is helpful in cases where one is interested in the intermediate results of an experiment, which one might regularly want to write to the database. Logtables have to be specified to the ``DATABASE`` section of the experiment configuration file. The logtables are defined similar to the ``resultfields`` the following way:
In addition to the functionality stated above, ``PyExperimenter`` also supports ``logtables`` thereby enabling the logging of information into separate tables. This is helpful in cases where one is interested in the intermediate results of an experiment, which one might regularly want to write to the database. Logtables have to be specified to the ``DATABASE`` section of the experiment configuration file. The logtables are defined similarly to the ``resultfields`` in the following way:

.. code-block:: yml
Expand All @@ -134,22 +143,21 @@ In addition to the functionality stated above, ``PyExperimenter`` also supports
f1: DOUBLE
accuracy: DOUBLE
kernel: VARCHAR(50)
Note that the name of the logtable is modified in the databse to ``<maintable_name>_<logtable_name>``.

Note that every logtable, however it is defined, additionally has the following fields:
Additionally lotgables have the following fields:

- ``experiment_id (int)``: The id of the experiment the logtable entry belongs to.
- ``timestamp (datetime)``: The timestamp the logtable entry has been created.

Additionally, the table is created in the database with the name ``<maintable_name>_<logtable_name>``.

An in-depth example showcasing the usage of logtables can be found within the :ref:`examples section <examples>`.


---------------------
Execution Information
---------------------

Furthermore, it is possible to define parameters for execution. They will not be part of the database, but are only used to configure the PyExperimenter. Currently, the following parameters are supported:
Furthermore, it is possible to define parameters for execution. They will not be part of the database but are only used to configure the PyExperimenter. Currently, the following parameters are supported:

- ``n_jobs: <int>``: The maximum number of experiments that will be executed in parallel. Default is ``1``.

Expand Down

0 comments on commit c964577

Please sign in to comment.