MetricsSummaryDisplay#

class skore.MetricsSummaryDisplay(rows, report_type)[source]#

Display for summarize.

An instance of this class will be created by Report.metrics.summarize(). This class should not be instantiated directly.

Parameters:
rowslist of dicts

The rows to display. Expected keys: - ā€œmetricā€: human-readable metric name shown in the display. - ā€œestimator_nameā€ - ā€œdata_sourceā€: ā€œtrainā€ or ā€œtestā€. - ā€œscoreā€: numeric metric value (scalar). - ā€œfavorabilityā€: ā€œ(ā†—ļøŽ)ā€, ā€œ(ā†˜ļøŽ)ā€ or ā€œā€.

Depending on the metric shape and report type, rows may also contain: - ā€œlabelā€: class label for per-class classification metrics. - ā€œoutputā€: output index for multioutput regression metrics. - ā€œaverageā€: averaging mode when averaged over labels or outputs. - ā€œsplitā€: cross-validation split index.

report_type{ā€œestimatorā€, ā€œcomparison-estimatorā€, ā€œcross-validationā€, ā€œcomparison-cross-validationā€}

The type of report.

frame(*, aggregate=('mean', 'std'), favorability=False, flat_index=False)[source]#

Return the summarize as a dataframe.

Parameters:
aggregate{ā€œmeanā€, ā€œstdā€}, list of such str or None, default=(ā€œmeanā€, ā€œstdā€)

Only used when report_type includes "cross-validation". Functions to aggregate the scores across the cross-validation splits. None will return the scores for each split.

favorabilitybool, default=False

Whether or not to add an indicator of the favorability of the metric as an extra column in the returned DataFrame.

flat_indexbool, default=False

Whether to return a flat index or a multi-index.

Returns:
framepandas.DataFrame

The report metrics as a dataframe.

help()[source]#

Display display help using rich or HTML.

plot()[source]#

Not yet implemented.

set_style(*, policy='update', **kwargs)[source]#

Set the style parameters for the display.

Parameters:
policyLiteral[ā€œoverrideā€, ā€œupdateā€], default=ā€updateā€

Policy to use when setting the style parameters. If ā€œoverrideā€, existing settings are set to the provided values. If ā€œupdateā€, existing settings are not changed; only settings that were previously unset are changed.

**kwargsdict

Style parameters to set. Each parameter name should correspond to a a style attribute passed to the plot method of the display.

Returns:
None
Raises:
ValueError

If a style parameter is unknown.

static style_plot(plot_func)[source]#

Apply consistent style to skore displays.

This decorator: 1. Applies default style settings 2. Runs plot_func under plt.ioff() so figures are not shown until returned 3. Calls Figure.tight_layout() on the returned figure when applicable 4. Deregisters pyplot-managed figures created during the display call 5. Restores the original style settings

Parameters:
plot_funccallable

The plot function to be decorated.

Returns:
callable

The decorated plot function.