PythonResultTracker

class PythonResultTracker(store_metrics: bool = True)[source]

Bases: ResultTracker

A tracker which stores everything in Python dictionaries.

Example Usage: get default configuration

from pykeen.pipeline import pipeline
from pykeen.trackers import PythonResultTracker

tracker = PythonResultTracker()
result = pipeline(
    dataset="nations",
    model="PairRE",
    result_tracker=tracker,
)
print("Default configuration:")
for k, v in tracker.configuration.items():
    print(f"{k:20} = {v}")

Initialize the tracker.

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.

Methods Documentation

Parameters:

store_metrics (bool)

log_metrics(metrics: Mapping[str, float], step: int | None = None, prefix: str | None = None) None[source]

Log metrics to result store.

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

  • step (int | None) – An optional step to attach the metrics to (e.g. the epoch).

  • prefix (str | None) – An optional prefix to prepend to every key in metrics.

Return type:

None

log_params(params: Mapping[str, Any], prefix: str | None = None) None[source]

Log parameters to result store.

Parameters:
Return type:

None

start_run(run_name: str | None = None) None[source]

Start a run with an optional name.

Parameters:

run_name (str | None)

Return type:

None