CVResult

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

class CVResult(fold_metrics: Tuple[Mapping[str, float], ...], mean_metrics: Mapping[str, float], std_metrics: Mapping[str, float], n_splits: int, manifest: RunManifest, pipelines: Tuple[TablePipeline, ...] = (), fold_best_params: Tuple[Mapping[str, Any], ...] = ())[source]

Bases: object

Outcome of cross_validate(), entirely in memory.

fold_metrics

Metric panel per fold, in fold order.

Type:

Tuple[Mapping[str, float], …]

mean_metrics

Panel averaged across folds (NaN-safe).

Type:

Mapping[str, float]

std_metrics

Panel standard deviation across folds (NaN-safe).

Type:

Mapping[str, float]

n_splits

Number of folds actually run.

Type:

int

pipelines

The per-fold fitted pipelines, in fold order. Each was fitted on its own training rows only; keeping them lets a caller inspect fold-level selection stability without refitting.

Type:

Tuple[habit.pipeline.TablePipeline, …]

manifest

Record of what ran: the effective spec payload, the provenance chain, and every row’s outcome. Under nested cross-validation the recorded spec is the UNTUNED declaration – the protocol being evaluated – because there is no single tuned spec: each outer fold selected its own (see fold_best_params).

Type:

habit.contracts.manifest.RunManifest

fold_best_params

Winning hyperparameters of each outer fold’s inner search, in fold order; empty for a plain (non-nested) run. Their SPREAD is the number a nested-CV report needs: parameters that change from fold to fold say the search is fitting noise.

Type:

Tuple[Mapping[str, Any], …]

__init__(fold_metrics: Tuple[Mapping[str, float], ...], mean_metrics: Mapping[str, float], std_metrics: Mapping[str, float], n_splits: int, manifest: RunManifest, pipelines: Tuple[TablePipeline, ...] = (), fold_best_params: Tuple[Mapping[str, Any], ...] = ()) → None