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_typeincludes"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.
- 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_funcunderplt.ioff()so figures are not shown until returned 3. CallsFigure.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.
Gallery examples#
EstimatorReport: Get insights from any scikit-learn estimator