CSVResultTracker

class CSVResultTracker(path=None, name=None, **kwargs)[source]

Bases: FileResultTracker

Tracking results to a CSV file.

Also allows monitoring experiments, e.g. by

tail -f results.txt | grep "hits_at_10"

Initialize the tracker.

Parameters:
  • path (Union[None, str, Path]) – The path of the log file.

  • name (Optional[str]) – The default file name for a file if no path is given. If no default is given, the current time is used.

  • kwargs – Additional keyword based arguments forwarded to csv.writer.

Attributes Summary

HEADER

The column names

extension

The file extension for this writer (do not include dot)

Methods Summary

log_metrics(metrics[, step, prefix])

Log metrics to result store.

log_params(params[, prefix])

Log parameters to result store.

start_run([run_name])

Start a run with an optional name.

Attributes Documentation

HEADER = ('type', 'step', 'key', 'value')

The column names

extension: ClassVar[str] = 'csv'

The file extension for this writer (do not include dot)

Methods Documentation

log_metrics(metrics, step=None, prefix=None)[source]

Log metrics to result store.

Parameters:
  • metrics (Mapping[str, float]) – The metrics to log.

  • step (Optional[int]) – An optional step to attach the metrics to (e.g. the epoch).

  • prefix (Optional[str]) – An optional prefix to prepend to every key in metrics.

Return type:

None

log_params(params, prefix=None)[source]

Log parameters to result store.

Return type:

None

Parameters:
start_run(run_name=None)[source]

Start a run with an optional name.

Return type:

None

Parameters:

run_name (str | None) –