Simple results

Summary

Results of tuning using a simple trainer.

TuningResults has many Training objects, each representing training for a one letstune.Params object.

Reporting

TuningResults provides useful reporting utilities, like dataframe export.

The dataframe can be used for further analysis and visualization.

Model loading

To unpickle the best model:

chk = tuning[0].checkpoint
model = chk.load_pickle()

Tuning results class

class letstune.results.simple.TuningResults

Results of simple training.

List of Training objects, each representing one letstune.Params.

Bases: typing.Generic [P], collections.abc.Sequence [letstune.results.simple.Training [P]]

__getitem__(i: int) letstune.results.simple.Training[P]

Get i-th best training. tuning[0] gives the best training.

__getitem__(slice: slice) list[letstune.results.simple.Training[P]]

Get slice of top trainings. tuning[:5] gives 5 best trainings.

__len__() int

Get number of trainings.

property errors: collections.abc.Sequence[letstune.results.simple.Error]

Sequence of failed trainings.

property metric: str

Metric used in the tuning.

to_df() DataFrame

Get dataframe describing all trainings in the tuning.

Columns correspond to fields from training objects.

Other classes

class letstune.results.simple.Training

Training of a model for given letstune.Params.

Bases: typing.Generic [ P ]

Basic data

training_id: int
params: P

Metric values

metric_values: MappingProxyType[str, float]
metric_value: float

Time

start_time: datetime
end_time: datetime
property duration: timedelta

Time elapsed from start_time to end_time.

Checkpoint

property checkpoint: Any

Checkpoint with fitted model during this training.

class letstune.results.simple.Error(*, training_id: int, params: str, msg: str)
training_id: int
params: str
msg: str