ScoringMonitorLog#

class sklearn.callback.ScoringMonitorLog(run_id: UUID, estimator_name: str, timestamp: datetime, train_scores: list[dict], val_scores: list[dict])[source]#

Log for one run of a scoring monitor.

Training and validation scores are respectively accessed through the train_scores and val_scores attributes, as lists of dicts, or through train_scores_as_pandas and val_scores_as_pandas, as Pandas DataFrames. In the list form, each dict corresponds to one row of the corresponding DataFrame and contains column_name -> value pairs. Both tables have the same columns:

  • task_id_path: tuple containing the task ids from the root task to the task for which the score was computed. Each value in this column is unique.

  • parent_task_id_path: tuple containing the task ids from the root to the parent task. It can be used to group scores from tasks that have the same parent task.

  • estimator_name: the name of the estimator.

  • task_name: the name of the task.

  • task_id: the id of the task.

  • sequential_subtasks: whether the task has sequential subtasks.

  • A column for each score name. On train_scores, these come from the scoring_train parameter. On val_scores, they come from scoring_val. A table is empty when the corresponding scorer is disabled ("no_train_score" or "no_val_score") or when that data was not provided.

Attributes:
run_iduuid.UUID

The unique identifier for the run.

estimator_namestr

The name of the estimator for the run.

timestampdatetime.datetime

The timestamp of the start of the run.

train_scoreslist[dict]

The recorded scores on the training data for the run.

train_scores_as_pandaspandas.DataFrame

The recorded scores on the training data for the run as a Pandas DataFrame.

val_scoreslist[dict]

The recorded scores on the validation data for the run.

val_scores_as_pandaspandas.DataFrame

The recorded scores on the validation data for the run as a Pandas DataFrame.