morphoclass.training.training_log module

Implementation of the training log.

class morphoclass.training.training_log.TrainingLog(config: morphoclass.training.training_config.TrainingConfig, labels_str: Sequence[str])

Bases: object

A training log.

At the moment this mirrors the dictionary log in the training entry point. The structure is suboptimal and should be refactored at a later time.

add_split(history: dict)None

Add the history of a split training to the training log.

classmethod from_dict(data: dict)morphoclass.training.training_log.TrainingLog

Reconstruct the training log from a dictionary.

static get_env_metadata()dict

Get the morphoclass environment metadata.

classmethod load(path: pathlib.Path)morphoclass.training.training_log.TrainingLog

Load the training log from disk.

property pretraining_log

Get the training log of the pretrained model.

save(path: pathlib.Path)None

Save the training log to disk.

set_all_history(history)

Add the history of the training on all data to the training log.

set_cleanlab_stats(errors, self_confidence)

Set the cleanlab evaluation data.

set_metrics(metrics, split_metrics)

Set the metric.

set_y(targets, predictions, probabilities)

Set the targets, predictions, and the probabilities.

to_dict()dict

Convert the training log to a dictionary.