neuraxle.metrics

Neuraxle’s metrics classes

The neuraxle classes to track metrics results.

Classes

MetricsWrapper(wrapped, metrics, VT], name)

Add metrics calculation to a step.

class neuraxle.metrics.MetricsWrapper(wrapped: neuraxle.base.BaseStep, metrics: Dict[KT, VT], name: str = None, print_metrics=False, print_fun=<built-in function print>)[source]

Add metrics calculation to a step. Calculates metrics after each fit, fit_transform, or even transform if there is an expected outputs.

Example usage :

wrapped = MetricsWrapper(wrapped=wrapped, metrics=self.batch_metrics, name=BATCH_METRICS_STEP_NAME)
wrapped = MiniBatchSequentialPipeline(
    [wrapped],
    batch_size=self.batch_size,
    enabled=True
)

# toggle metrics on, and off
wrapped.apply('toggle_metrics')
disable_metrics()[source]

Disable metrics wrapper metrics if needed..

Returns

enable_metrics()[source]

Enable metrics wrapper metrics if needed..

Returns

get_metrics() → Dict[KT, VT][source]

Get all metrics results using the transformed data container, and the metrics function dict. To be used with neuraxle.base.BaseStep.apply() method.

Returns

dict with the step name as key, and all of the training, and validation metrics as values

toggle_metrics()[source]

Toggle metrics wrapper on and off to temporarily disable metrics if needed..

Returns