coco_pipe.report.decoding#

Composable section builders for decoding reports.

Attributes#

Exceptions#

SectionDataUnavailable

Signal that a report section is inapplicable because its data is absent.

Functions#

build_decoding_overview_section(result, *[, name])

Build high-level decoding context.

build_decoding_summary_section(result, *[, name])

Build the scalar model-performance summary.

build_cv_section(result, *[, metric, model, name, ...])

Build fold scores and score dispersion only.

build_probability_section(result, *[, model, name, ...])

Build confusion, ROC, precision-recall, and calibration diagnostics.

build_statistical_section(result, *[, metric, model, ...])

Build finite-sample and temporal statistical assessment.

build_temporal_section(result, *[, metric, model, ...])

Build temporal score and generalization diagnostics when applicable.

build_performance_section(result, *[, metric, name, ...])

Build aggregate score and paired model-comparison figures.

build_features_section(result, *[, feature_metadata, ...])

Build feature importance, stability, and sensor-family summaries.

build_topomaps_section(result, *[, feature_metadata, ...])

Build feature-family sensor profiles when spatial metadata exists.

build_fit_diagnostics_section(result, *[, model, ...])

Build timing and warning diagnostics as supplementary content.

build_tuning_section(result, *[, model, name, ...])

Build best-parameter and search-result diagnostics.

build_neural_section(result, *[, model, name, ...])

Build neural training artifacts when available.

build_configuration_section(result, *[, name])

Build the stored run configuration.

build_provenance_section(result, *[, name])

Build environment and provenance metadata.

build_caveats_section(result, *[, feature_metadata, name])

Build explicit caveats for unavailable optional diagnostics.

build_export_inventory_section(result, *[, name])

Build a compact inventory of available result accessors.

build_decoding_sections(result, *[, sections, ...])

Build ordered decoding sections without creating or mutating a report.

make_decoding_result_report(result, *[, ...])

Build a report for one ~coco_pipe.decoding.result.ExperimentResult.

render_unit_reports(records, *, modes[, ...])

Render per-unit decoding reports from successful sweep artifacts.

add_decoding_overview(self, result, *[, name])

add_decoding_summary(self, result[, name])

add_decoding_statistical_assessment(self, result[, ...])

add_decoding_temporal(self, result[, metric, model, name])

add_decoding_performance(self, result, *[, metric, name])

add_decoding_features(self, result, *[, ...])

add_decoding_topomaps(self, result, *[, ...])

add_decoding_neural_artifacts(self, result[, model, name])

Module Contents#

exception coco_pipe.report.decoding.SectionDataUnavailable#

Bases: RuntimeError

Signal that a report section is inapplicable because its data is absent.

coco_pipe.report.decoding.build_decoding_overview_section(result, *, name='Overview')#

Build high-level decoding context.

Parameters:
  • result (Any)

  • name (str)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_decoding_summary_section(result, *, name='Model Performance')#

Build the scalar model-performance summary.

Parameters:
  • result (Any)

  • name (str)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_cv_section(result, *, metric=None, model=None, name='Cross-Validation', include_tables=False, interactive=False)#

Build fold scores and score dispersion only.

Parameters:
  • result (Any)

  • metric (str | None)

  • model (str | None)

  • name (str)

  • include_tables (bool)

  • interactive (bool)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_probability_section(result, *, model=None, name='Confusion and Probability', include_tables=False, interactive=False)#

Build confusion, ROC, precision-recall, and calibration diagnostics.

Parameters:
  • result (Any)

  • model (str | None)

  • name (str)

  • include_tables (bool)

  • interactive (bool)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_statistical_section(result, *, metric=None, model=None, name='Statistical Assessment', interactive=False)#

Build finite-sample and temporal statistical assessment.

Parameters:
  • result (Any)

  • metric (str | None)

  • model (str | None)

  • name (str)

  • interactive (bool)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_temporal_section(result, *, metric=None, model=None, name='Temporal Decoding', include_tables=False, interactive=False)#

Build temporal score and generalization diagnostics when applicable.

Parameters:
  • result (Any)

  • metric (str | None)

  • model (str | None)

  • name (str)

  • include_tables (bool)

  • interactive (bool)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_performance_section(result, *, metric=None, name='Performance', interactive=False)#

Build aggregate score and paired model-comparison figures.

Parameters:
  • result (Any)

  • metric (str | None)

  • name (str)

  • interactive (bool)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_features_section(result, *, feature_metadata=None, model=None, top_n=20, name='Features', include_tables=False, interactive=False)#

Build feature importance, stability, and sensor-family summaries.

Parameters:
Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_topomaps_section(result, *, feature_metadata=None, info=None, coords=None, name='Sensor Maps')#

Build feature-family sensor profiles when spatial metadata exists.

Parameters:
Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_fit_diagnostics_section(result, *, model=None, name='Fit Diagnostics', include_tables=False, supplementary=True, interactive=False)#

Build timing and warning diagnostics as supplementary content.

Parameters:
  • result (Any)

  • model (str | None)

  • name (str)

  • include_tables (bool)

  • supplementary (bool)

  • interactive (bool)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_tuning_section(result, *, model=None, name='Hyperparameter Tuning', include_tables=False, supplementary=True, interactive=False)#

Build best-parameter and search-result diagnostics.

Parameters:
  • result (Any)

  • model (str | None)

  • name (str)

  • include_tables (bool)

  • supplementary (bool)

  • interactive (bool)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_neural_section(result, *, model=None, name='Neural Artifacts', include_tables=False, interactive=False)#

Build neural training artifacts when available.

Parameters:
  • result (Any)

  • model (str | None)

  • name (str)

  • include_tables (bool)

  • interactive (bool)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_configuration_section(result, *, name='Configuration')#

Build the stored run configuration.

Parameters:
  • result (Any)

  • name (str)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_provenance_section(result, *, name='Provenance')#

Build environment and provenance metadata.

Parameters:
  • result (Any)

  • name (str)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_caveats_section(result, *, feature_metadata=None, name='Caveats')#

Build explicit caveats for unavailable optional diagnostics.

Parameters:
Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.build_export_inventory_section(result, *, name='Export Inventory')#

Build a compact inventory of available result accessors.

Parameters:
  • result (Any)

  • name (str)

Return type:

coco_pipe.report.core.Section

coco_pipe.report.decoding.DECODING_SECTION_BUILDERS: dict[str, collections.abc.Callable[..., coco_pipe.report.core.Section]]#
coco_pipe.report.decoding.VALID_SECTIONS#
coco_pipe.report.decoding.build_decoding_sections(result, *, sections='default', feature_metadata=None, info=None, coords=None, verbose=None, interactive=False, on_error='warn', section_options=None)#

Build ordered decoding sections without creating or mutating a report.

Parameters:
  • sections (str | collections.abc.Sequence[str]) – A preset name ("compact", "default", "full") or an explicit list of section keys from DECODING_SECTION_BUILDERS.

  • verbose (bool | None) – Controls the include_tables flag passed to table-bearing sections (cv, probability, temporal, features, fit_diagnostics, tuning, neural). When None it defaults to True only for the "full" preset, so detailed tables appear in full reports and are suppressed in the leaner presets.

  • section_options (collections.abc.Mapping[str, collections.abc.Mapping[str, Any]] | None) – Per-section keyword overrides, keyed by section name; the inner mapping is forwarded to that section’s builder. For example {"cv": {"metric": "accuracy"}, "features": {"top_n": 30}}. Explicit keys here take precedence over the values derived from feature_metadata, info, coords, verbose, and interactive.

  • result (Any)

  • feature_metadata (pandas.DataFrame | None)

  • info (Any)

  • coords (Any)

  • interactive (bool)

  • on_error (Literal['raise', 'warn', 'placeholder'])

Return type:

list[coco_pipe.report.core.Section]

coco_pipe.report.decoding.make_decoding_result_report(result, *, feature_metadata=None, info=None, coords=None, sections='default', interactive=False, theme='paper', title='Decoding Report', config=None, asset_urls=None, qc_result=None, output_path=None, verbose=None, on_error='warn', section_options=None)#

Build a report for one ~coco_pipe.decoding.result.ExperimentResult.

This is the single-result renderer (one model set on one analysis unit). For a whole classical sweep, see coco_pipe.report.decoding_sweep.make_decoding_report().

With interactive=True, chart-like sections render Plotly figures; topomap and sensor-map sections remain Matplotlib images (no Plotly twin exists).

Parameters:
Return type:

coco_pipe.report.core.Report

coco_pipe.report.decoding.render_unit_reports(records, *, modes, feature_metadata=None, asset_urls='inline', title_fn=None, sections='compact', on_error='placeholder')#

Render per-unit decoding reports from successful sweep artifacts.

Parameters:
Return type:

None

coco_pipe.report.decoding.add_decoding_overview(self, result, *, name='Overview')#
Parameters:
Return type:

coco_pipe.report.core.Report

coco_pipe.report.decoding.add_decoding_summary(self, result, name='Decoding Summary')#
Parameters:
Return type:

coco_pipe.report.core.Report

coco_pipe.report.decoding.add_decoding_statistical_assessment(self, result, metric=None, model=None, name='Statistical Assessment')#
Parameters:
Return type:

coco_pipe.report.core.Report

coco_pipe.report.decoding.add_decoding_temporal(self, result, metric=None, model=None, name='Temporal Decoding')#
Parameters:
Return type:

coco_pipe.report.core.Report

coco_pipe.report.decoding.add_decoding_performance(self, result, *, metric=None, name='Performance')#
Parameters:
Return type:

coco_pipe.report.core.Report

coco_pipe.report.decoding.add_decoding_features(self, result, *, feature_metadata=None, name='Features')#
Parameters:
Return type:

coco_pipe.report.core.Report

coco_pipe.report.decoding.add_decoding_topomaps(self, result, *, feature_metadata=None, info=None, coords=None, name='Sensor Maps')#
Parameters:
Return type:

coco_pipe.report.core.Report

coco_pipe.report.decoding.add_decoding_neural_artifacts(self, result, model=None, name='Neural Artifacts')#
Parameters:
Return type:

coco_pipe.report.core.Report