PreciseFeatureSet

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 PreciseFeatureSet(feature_names: Tuple[str, ...], lcl_threshold: float, experiments: Tuple[str, ...], panels: Mapping[str, DataFrame], provenance: Provenance)[source]

Bases: object

Voxel features that passed the precision screen, with the evidence.

feature_names

Selected feature names, in panel column order.

Type:

Tuple[str, …]

lcl_threshold

Lower-confidence-limit cutoff every selected feature cleared in every experiment (unless expert-included).

Type:

float

experiments

Experiment names, matching panels.

Type:

Tuple[str, …]

panels

Cohort-level ICC panel per experiment (index: feature; columns: value, lcl, ucl, n_voxels).

Type:

Mapping[str, pandas.core.frame.DataFrame]

provenance

How this selection was produced.

Type:

habit.contracts.provenance.Provenance

__post_init__() → None[source]

Enforce the internal consistency of the artefact.

preprocessor() → Any[source]

Return the feature whitelist restricting a habitat run to these features.

Drop the returned component into a spec’s voxel_feature_preprocessors chain (or use its .spec in a YAML-facing payload) and the habitat computation clusters exactly the precise features – the Prior et al. 2024 workflow.

Returns:

A FeatureWhitelist over feature_names.

to_frame() → DataFrame[source]

Return the long-format evidence table.

Returns:

One row per experiment per feature, with columns experiment, feature, value, lcl, ucl, n_voxels and precise.

save(path: str | Path) → Path[source]

Serialise to one self-describing JSON file.

Parameters:

path – Destination file; the parent directory must exist.

Returns:

The path written.

classmethod load(path: str | Path) → PreciseFeatureSet[source]

Load a serialised precise feature set.

Parameters:

path – File written by save().

Returns:

The reconstructed artefact.

Raises:

HABITAPIError – If the file is not a PreciseFeatureSet serialisation.

__init__(feature_names: Tuple[str, ...], lcl_threshold: float, experiments: Tuple[str, ...], panels: Mapping[str, DataFrame], provenance: Provenance) → None

Examples using habit.precision.PreciseFeatureSet

Precise voxel features

Precise voxel features