5. experipy.metrics - Results Parsing¶
This module provides the Metric class as a means of defining and extracting values from the results of Experiment runs.
5.1. Metric objects¶
Metric(name, filename, regex, parser=<type 'float'>)¶
Metric objects define a value to be extracted from a given file.
A metric consists of a base filename, a regex with which to search that file, and a parser which converts the value, once found, into the desired type.
- name (str) – The name of the metric.
- filename (str) – The name of the file in a given results directory to search.
For instance, if the metric should appear in the standard
output of a given experiment, then filename should be set as
- regex (str) – A string which will be compiled as a regular expression and
used to search for the metric. Must contain a Named Group with
- parser (callable) – A callable taking a single string argument and returning the
value converted to the desired type. Defaults to
Given a path to a results directory, attempt to extract the value. Optionally provide a default value in the event the value can’t be found.