Plugin introspection API

Stable HABIT plugin discovery and inspection API.

Implementation lives in habit.plugins.catalog. For v2 built-in components, prefer plugin_catalog() or constructor_signature().

User guide: Habitat Spec component catalog · Component registry. Discover built-in and entry-point components. Parameter order is always (name, domain).

Classes

PluginInfo

Describe one component registered in a HABIT plugin domain.

PluginParamInfo

One Spec / Registry.create parameter from the v2 constructor.

PluginCatalogEntry

One catalog row derived from the constructor contract (not a hand-copied table).

PluginLoadReport

Report loaded external entry points and non-fatal discovery failures.

Functions

list_plugins

List registered HABIT extension components without exposing core registries.

get_plugin_info

Return metadata for one registered component or raise a clear API error.

get_param_schema

Return a legacy Pydantic params_model for a plugin, if registered.

plugin_catalog

Build a live catalog from each plugin's constructor contract.

format_plugin_catalog_rst

Render plugin_catalog() as reStructuredText for the docs catalog.

load_plugins

Load external HABIT plugins declared through standard Python entry points.

setup_logger

Setup a logger for a HABIT module or script.

is_available

Return whether an optional third-party module can be imported.

show_versions

Return HABIT and key dependency versions for reproducibility and debugging.

check_component

Return whether name is registered in a HABIT plugin domain.

from habit.plugins import get_plugin_info, list_plugins, load_plugins
from habit.supervoxel import SlicSupervoxelizer, SupervoxelizerRegistry

report = load_plugins(strict=False)
print(report.loaded, report.failures)

all_plugins = list_plugins()
habitat_only = list_plugins("habitat_model_fitter")

info = get_plugin_info("slic", "supervoxelizer")
print(info.name, info.domain, info.implementation, info.provider)

# Parameters live on the component constructor, not a Params model.
print(SupervoxelizerRegistry.available())
print(SupervoxelizerRegistry.constructor_signature("slic"))
slic = SupervoxelizerRegistry.create("slic", n_supervoxels=50)
slic = SlicSupervoxelizer(n_supervoxels=50)

load_plugins resilience

  • strict=False (default) — broken entry points are recorded in PluginLoadReport.failures and logged as warnings; discovery continues

  • strict=True — the first load error is re-raised immediately

report = load_plugins(strict=False)
if report.failures:
    for name, message in report.failures.items():
        print("plugin failure:", name, message)

# CI / production gate: abort if any third-party plugin is broken
load_plugins(strict=True)

Legacy plural domains (e.g. habitat_features, models) still resolve but emit HabitDeprecationWarning; prefer the v1 singular domains below.

v1 protocol domains

Use these domain strings with list_plugins / get_plugin_info:

V1_DOMAINS = [
    "voxel_feature_extractor",
    "supervoxelizer",
    "supervoxel_feature_extractor",
    "habitat_model_fitter",
    "habitat_assigner",
    "habitat_feature_extractor",
    "combiner",
    "image_perturbation",
    "preprocessor",
    "table_preprocessor",
    "feature_selector",
    "classifier",
    "metric",
]
for domain in V1_DOMAINS:
    print(domain, [p.name for p in list_plugins(domain)])

Enumerate registered names:

for plugin in list_plugins():
    print(plugin.domain, plugin.name)

Which Spec / create names exist

The component __init__ is the only parameter contract: types, defaults, allowed values or ranges, validation, and same-named public attributes. Registry.create("name", **kwargs) forwards those constructor arguments. Do not copy parameter tables into YAML or notebooks — they rot. Look names up with list_plugins / Registry.available(), and read the constructor (or Registry.constructor_signature) for parameters.

from habit.plugins import list_plugins
from habit.table_preprocessing import TablePreprocessorRegistry

print([info.name for info in list_plugins("table_preprocessor")])
print(TablePreprocessorRegistry.constructor_signature("minmax"))
scaler = TablePreprocessorRegistry.create("minmax")

A bad name on Registry.create / get_plugin_info lists the names that are registered in that domain.

Live catalog

Each entry is one line of purpose, required vs optional constructor parameters, one Spec / Registry.create example, and a parameter table (default, allowed values / type, meaning). YAML name: / params: blocks use the same constructor names.

Habitat stages organised by scientific module: Habitat Spec component catalog.

voxel_feature_extractor

concat

Join several voxel feature families side by side for the same voxels. Required: extractors. Optional: roi, modalities, expression. Spec("concat", {"extractors": ...}) Registry.create("concat", extractors=...)

Param

Default

Allowed / type

Meaning

extractors

(required)

Sequence

Child specifications as {"name": ..., "params": {...}} mappings, resolved through the voxel-feature registry in the given order. A child’s own roi is overridden by this operator’s.

roi

None

str | None

Mask key defining the region of interest for every child; None uses the subject’s single mask.

modalities

()

Sequence

Accepted for configuration compatibility and ignored; each child names the modalities it reads.

expression

None

str | None

The original v0 method expression, carried for provenance when this extractor was reached by config translation.

expression

Per-voxel features defined by restricted arithmetic expressions. Required: (none). Optional: features, expressions, feature_names, modalities, roi, eps. Spec("expression") Registry.create("expression")

Param

Default

Allowed / type

Meaning

features

None

Mapping | None

Mapping of feature name to formula. Mutually exclusive with expressions.

expressions

None

Sequence | None

Ordered formulas when names are not provided up front.

feature_names

None

Sequence | None

Names aligned with expressions; defaults to expr_0, expr_1, …

modalities

()

Sequence

Optional explicit modality list. When empty, modality names are inferred from identifiers used in the formulas (excluding builtins and function names).

roi

None

str | None

Mask key; None uses the subject’s single mask.

eps

1e-08

float

Value bound to the name eps inside every formula.

kinetic

Per-voxel enhancement slopes across a dynamic contrast series. Required: timestamps. Optional: phases, roi, time_format, modalities, expression. Spec("kinetic", {"timestamps": ...}) Registry.create("kinetic", timestamps=...)

Param

Default

Allowed / type

Meaning

timestamps

(required)

str | Mapping

Acquisition times per subject, either as a mapping {subject_id: {phase: "HH-MM-SS"}} for API callers, or a path to the v0.1 timestamp table.

phases

('pre_contrast', 'LAP', 'PVP', 'delay_3min')

Sequence

Modality keys of the series in acquisition order: unenhanced, arterial, portal-venous, delayed.

roi

None

str | None

Mask key defining the region of interest; None uses the subject’s single mask.

time_format

'%H-%M-%S'

str

strptime format of the timestamp values.

modalities

()

Sequence

Accepted for configuration compatibility and ignored; phases defines which images are read, because the four phases have fixed roles that a flat list cannot express.

expression

None

str | None

The original v0 method expression, carried for provenance when this extractor was reached by config translation.

local_entropy

Shannon entropy of each voxel’s intensity neighbourhood. Required: (none). Optional: modalities, roi, kernel_size, bins, modality, as_. Spec("local_entropy") Registry.create("local_entropy")

Param

Default

Allowed / type

Meaning

modalities

()

Sequence

Modality keys to describe, in feature order; empty selects every image the subject carries.

roi

None

str | None

Mask key defining the region of interest; None uses the subject’s single mask.

kernel_size

3

int

Neighbourhood edge length in voxels. Even values are incremented to keep the neighbourhood centred, as in v0.1.

bins

32

int

Histogram bins used to discretise intensities.

modality

None

str | None

Single modality key – the explicit form used inside feature trees. Mutually exclusive with modalities.

as_

None

str | None

Optional output-column alias. Valid only with exactly one resolved modality; the column suffix then uses the alias.

raw

Per-voxel raw intensity of every requested modality inside the ROI. Required: (none). Optional: modalities, roi, modality, as_. Spec("raw") Registry.create("raw")

Param

Default

Allowed / type

Meaning

modalities

()

Sequence

Modality keys to read from the subject, in feature order – the historical convenience that stacks several modalities into one node without a concat combiner.

roi

None

str | None

Mask key defining the region of interest; None uses the subject’s single mask.

modality

None

str | None

Single modality key – the explicit form used inside feature trees (raw("T1")). Mutually exclusive with modalities.

as_

None

str | None

Optional output-column alias. Valid only with exactly one resolved modality; the column is then named after the alias instead of the modality.

voxel_radiomics

Describe every ROI voxel by a PyRadiomics feature vector. Required: (none). Optional: modalities, roi, params_file, params, kernel_radius, voxel_batch, use_torch_radiomics, torch_device, torch_dtype, use_gpu_matrices, output_float32, class_progress, crop_to_roi, cache_dir, modality, as_. Spec("voxel_radiomics") Registry.create("voxel_radiomics")

Param

Default

Allowed / type

Meaning

modalities

()

Sequence

Modality keys to extract from, in feature order; empty selects every image the subject carries.

roi

None

str | None

Mask key defining the region of interest; None uses the subject’s single mask.

params_file

None

str | None

Path to a PyRadiomics parameter YAML; None selects the bundled voxel preset.

params

None

dict | None

Inline PyRadiomics settings, for API callers holding settings in memory. Mutually exclusive with params_file.

kernel_radius

3

int

Neighbourhood radius in voxels; radius 1 is a 3x3x3 cube, radius 3 a 7x7x7 cube.

voxel_batch

1000

int | str

ROI voxels per batch. Default 1000. Pass a larger integer on a 12–24 GB GPU, or "auto" to pick from VRAM.

use_torch_radiomics

'auto'

str | bool

"auto", True or False – whether to use the TorchRadiomics path when torch and CUDA are present.

torch_device

'auto'

str

Torch device string, or "auto" to select one.

torch_dtype

'float64'

str

"float64" (default) or "float32" for the torch path.

use_gpu_matrices

'auto'

str | bool

"auto", True or False – whether the TorchRadiomics texture matrices (GLCM, …) are built on GPU by habit.kernels.radiomics.gpumatrices instead of the single-threaded PyRadiomics C extension. "auto" follows the torch device. Bit-identical counts either way.

output_float32

True

bool

Downcast the feature columns to float32, the v0.1 default that keeps large voxel tables manageable.

class_progress

False

bool

When True, print and tqdm each PyRadiomics class (firstorder, glcm, …). Default False: one execute() with no per-class lines; Cohort.map still shows subject progress.

crop_to_roi

True

bool

When True (default), crop image and mask to the ROI bounding box plus kernel_radius padding before calling execute. PyRadiomics re-applies the identical crop internally, so feature values are bit-identical; the pre-crop just keeps the full-volume diagnostics (sitk.Hash, whole-image statistics) and mask checks off the big volume, saving several seconds per modality on whole-body scans.

cache_dir

None

str | None

Optional directory for extracted fields. A hit skips PyRadiomics. The cache key ignores voxel_batch and device knobs so a later run with a larger batch can reuse the file.

modality

None

str | None

Single modality key – the explicit form used inside feature trees. Mutually exclusive with modalities.

as_

None

str | None

Optional output-column alias. Valid only with exactly one resolved modality; the column suffix then uses the alias.

supervoxelizer

gmm

Partition the ROI by a Gaussian mixture over voxel features. Required: (none). Optional: n_supervoxels, max_iter, n_init, covariance_type. Spec("gmm") Registry.create("gmm")

Param

Default

Allowed / type

Meaning

n_supervoxels

50

int

Requested number of supervoxels, clamped to the ROI voxel count.

max_iter

300

int

Maximum EM iterations.

n_init

10

int

Number of EM restarts.

covariance_type

'full'

str

scikit-learn covariance parameterisation ("full", "tied", "diag", "spherical").

kmeans

Partition the ROI by k-means over voxel features. Required: (none). Optional: n_supervoxels, max_iter, n_init. Spec("kmeans") Registry.create("kmeans")

Param

Default

Allowed / type

Meaning

n_supervoxels

50

int

Requested number of supervoxels, clamped to the ROI voxel count.

max_iter

300

int

Maximum k-means iterations per restart.

n_init

10

int

Number of k-means restarts.

slic

Partition the ROI into SLIC supervoxels and average features within each. Required: (none). Optional: n_supervoxels, compactness, enforce_connectivity, estimator_params. Spec("slic") Registry.create("slic")

Param

Default

Allowed / type

Meaning

n_supervoxels

100

int

Requested number of supervoxels. Clamped to the number of ROI voxels (a partition cannot have more non-empty regions than voxels).

compactness

10.0

float

Balance between colour similarity and spatial proximity (skimage.segmentation.slic semantics).

enforce_connectivity

True

bool

When True, disconnected segments are relabelled so every supervoxel is connected.

estimator_params

None

Mapping | None

Extra keyword arguments forwarded verbatim to skimage.segmentation.slic (e.g. {"sigma": 1.0}), for vendor parameters HABIT does not declare. Keys colliding with a declared parameter or with a call argument HABIT controls (n_segments, mask, channel_axis, start_label) are rejected, and every key is validated against the vendor signature at call time: a key recorded in the spec fingerprint must reach the vendor function, never be silently dropped.

supervoxel_feature_extractor

mean

Average the voxel signal within each supervoxel, one modality at a time. Required: (none). Optional: modality, source, as_. Spec("mean") Registry.create("mean")

Param

Default

Allowed / type

Meaning

modality

None

str | None

See the component docstring.

source

'working'

str

See the component docstring.

as_

None

str | None

See the component docstring.

mean_voxel_features

Describe each supervoxel by the mean of the voxel features within it. Required: (none). Optional: field. Spec("mean_voxel_features") Registry.create("mean_voxel_features")

Param

Default

Allowed / type

Meaning

field

None

VoxelFeatureField | None

Voxel features to aggregate. Optional; see above.

percentile

A percentile of the voxel signal within each supervoxel. Required: (none). Optional: modality, source, q, as_. Spec("percentile") Registry.create("percentile")

Param

Default

Allowed / type

Meaning

modality

None

str | None

See the component docstring.

source

'working'

str

See the component docstring.

q

90.0

float

See the component docstring.

as_

None

str | None

See the component docstring.

std

Sample standard deviation of the voxel signal within each supervoxel. Required: (none). Optional: modality, source, as_. Spec("std") Registry.create("std")

Param

Default

Allowed / type

Meaning

modality

None

str | None

See the component docstring.

source

'working'

str

See the component docstring.

as_

None

str | None

See the component docstring.

supervoxel_radiomics

Describe each supervoxel by PyRadiomics features of the original images. Required: (none). Optional: modality, modalities, as_, params_file, params, supervoxel_batch, supervoxel_union_bbox_crop, supervoxel_pad_distance, use_supervoxel_cext, union_bin, use_torch_radiomics, torch_device, torch_dtype, output_float32. Spec("supervoxel_radiomics") Registry.create("supervoxel_radiomics")

Param

Default

Allowed / type

Meaning

modality

None

str | None

Single modality name; mutually exclusive with modalities.

modalities

()

Sequence

Modality names to extract from; empty selects all the subject carries.

as_

None

str | None

Alias used as the column suffix instead of the modality name; requires modality.

params_file

None

str | None

Path to a PyRadiomics parameter YAML, or None for PyRadiomics defaults.

params

None

dict | None

Inline PyRadiomics settings mapping, for API users holding settings in memory. Mutually exclusive with params_file.

supervoxel_batch

64

int

Labels processed per batch. Larger batches trade memory for speed and never change the numbers.

supervoxel_union_bbox_crop

True

bool

Crop image and masks to the bounding box of the union of all supervoxels before extraction.

supervoxel_pad_distance

None

int | None

Padding around that bounding box; None keeps the PyRadiomics padDistance setting.

use_supervoxel_cext

True

str | bool

True (default), "auto", or False – whether to use the habit native C extension for texture matrices.

union_bin

False

bool

When False (default) each supervoxel is discretized with its own binWidth edges, matching PyRadiomics execute(). When True, all labels share one union-mask bin.

use_torch_radiomics

'auto'

str | bool

"auto", True or False – whether to use the TorchRadiomics GPU path when torch and CUDA are present.

torch_device

'auto'

str

Torch device string, or "auto" to select one.

torch_dtype

'float64'

str

"float64" (default) or "float32" for the torch path.

output_float32

True

bool

Downcast the resulting feature columns to float32, the v0.1 default that keeps large supervoxel tables manageable.

feature_preprocessing_method

binning

Discretise features into ordinal bin indices. Required: (none). Optional: n_bins, bin_strategy, across_features. Spec("binning") Registry.create("binning")

Param

Default

Allowed / type

Meaning

n_bins

10

int

Number of bins.

bin_strategy

'uniform'

str

uniform, quantile or kmeans.

across_features

False

bool

Learn one set of edges from the pooled values.

correlation_filter

Greedily drop redundant, highly correlated feature columns. Required: (none). Optional: corr_threshold, corr_method. Spec("correlation_filter") Registry.create("correlation_filter")

Param

Default

Allowed / type

Meaning

corr_threshold

0.95

float

Absolute-correlation cut-off above which later columns are dropped.

corr_method

'spearman'

str

pearson, spearman or kendall.

feature_whitelist

Restrict the feature matrix to an explicit, externally derived list. Required: features. Optional: (none). Spec("feature_whitelist", {"features": ...}) Registry.create("feature_whitelist", features=...)

Param

Default

Allowed / type

Meaning

features

(required)

Sequence

Feature names to keep, in output order. At least one is required, and every name must be present in the matrix – a missing feature breaks the “same features” contract and raises rather than being silently dropped.

impute

Replace non-finite feature values with a learned per-column statistic. Required: (none). Optional: strategy. Spec("impute") Registry.create("impute")

Param

Default

Allowed / type

Meaning

strategy

'mean'

str

mean or median of each column’s finite values, or zero. Columns with no finite value at all impute to 0.0 regardless, so one unusable modality cannot invalidate a subject.

l2

Scale each row (voxel / supervoxel) to unit Euclidean length. Required: (none). Optional: (none). Spec("l2") Registry.create("l2")

log

Compress right-skewed features with log(x - min + 1). Required: (none). Optional: across_features. Spec("log") Registry.create("log")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

maxabs

Scale features by the maximum absolute value. Required: (none). Optional: across_features. Spec("maxabs") Registry.create("maxabs")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

minmax

Scale features to [0, 1]. Required: (none). Optional: across_features. Spec("minmax") Registry.create("minmax")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

precise_correlation_filter

Prior 2024 Spearman screen: signed r, p-value, keep the later column. Required: (none). Optional: corr_threshold, p_threshold. Spec("precise_correlation_filter") Registry.create("precise_correlation_filter")

Param

Default

Allowed / type

Meaning

corr_threshold

0.7

float

Signed Spearman cut-off; drop when r is greater.

p_threshold

0.05

float

Spearman p-value cut-off; drop only when p is smaller.

quantile

Map each feature onto a uniform or normal distribution by percentile rank. Required: (none). Optional: across_features, n_quantiles, output_distribution. Spec("quantile") Registry.create("quantile")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

n_quantiles

1000

int

See the component docstring.

output_distribution

'uniform'

str

See the component docstring.

robust

Centre features on the median and scale by the interquartile range. Required: (none). Optional: across_features. Spec("robust") Registry.create("robust")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

variance_filter

Drop feature columns whose variance is at or below a threshold. Required: (none). Optional: variance_threshold. Spec("variance_filter") Registry.create("variance_filter")

Param

Default

Allowed / type

Meaning

variance_threshold

0.0

float

Columns with var <= threshold are dropped; 0.0 removes only constant columns.

winsorize

Clip extreme values at tail quantiles instead of discarding them. Required: (none). Optional: winsor_limits, across_features. Spec("winsorize") Registry.create("winsorize")

Param

Default

Allowed / type

Meaning

winsor_limits

(0.05, 0.05)

tuple[float, float]

Lower and upper tail fractions to clip, each in [0, 0.5).

across_features

False

bool

Pool statistics across feature columns.

zscore

Standardise features to zero mean and unit variance. Required: (none). Optional: across_features. Spec("zscore") Registry.create("zscore")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

habitat_model_fitter

gmm

Learn population habitats by a Gaussian mixture over pooled features. Required: (none). Optional: n_habitats, min_habitats, max_habitats, validation, covariance_type, n_init, max_iter. Spec("gmm") Registry.create("gmm")

Param

Default

Allowed / type

Meaning

n_habitats

None

int | None

Fixed habitat count, or None to select it by validation.

min_habitats

2

int

Smallest candidate count during selection.

max_habitats

10

int

Largest candidate count during selection.

validation

'bic'

str | Sequence

Selection criterion, or a list of criteria that each cast one vote: "bic" / "aic" / "davies_bouldin" (minimise), "bic_elbow" (Prior 2024 BIC-slope elbow, not minimum BIC), or "silhouette" / "calinski_harabasz" / "gap" (maximise).

covariance_type

'full'

str

GaussianMixture covariance structure.

n_init

50

int

Number of mixture initialisations per candidate count; the best-likelihood run is kept (sklearn n_init).

max_iter

100

int

EM iteration limit per candidate count.

kmeans

Learn population habitats by k-means over pooled supervoxel features. Required: (none). Optional: n_habitats, min_habitats, max_habitats, validation, n_init, max_iter. Spec("kmeans") Registry.create("kmeans")

Param

Default

Allowed / type

Meaning

n_habitats

None

int | None

Fixed habitat count, or None to select it by validation.

min_habitats

2

int

Smallest candidate count during selection.

max_habitats

10

int

Largest candidate count during selection.

validation

'elbow'

str | Sequence

Selection criterion, or a list of criteria that each cast one vote: "elbow" / "kneedle" / "inertia" (Kneedle knee of the inertia curve; default "elbow"), "silhouette" / "calinski_harabasz" / "gap" (maximise), or "davies_bouldin" (minimise). Since v1.0 elbow is an alias of kneedle; see habit.kernels.cluster_selection. The default is the community-used inertia elbow over min_habitats=2 .. max_habitats=10.

n_init

50

int

k-means restarts per candidate count.

max_iter

300

int

Maximum k-means iterations per fit. Defaults to the scikit-learn default (300), which is also the value the v0.1 configuration schema recorded.

habitat_assigner

nearest_centroid

Assign each supervoxel to the habitat of its nearest centroid. Required: model. Optional: (none). Spec("nearest_centroid", {"model": ...}) Registry.create("nearest_centroid", model=...)

Param

Default

Allowed / type

Meaning

model

(required)

HabitatModel

The fitted habitat definition to project.

habitat_feature_extractor

each_habitat

PyRadiomics features of the raw image(s) within each habitat label. Required: (none). Optional: params_file, params, modalities, modality, as_, use_torch_radiomics, torch_device, torch_dtype. Spec("each_habitat") Registry.create("each_habitat")

Param

Default

Allowed / type

Meaning

params_file

None

str | None

See the component docstring.

params

None

dict | None

See the component docstring.

modalities

None

Sequence | None

See the component docstring.

modality

None

str | None

See the component docstring.

as_

None

str | None

See the component docstring.

use_torch_radiomics

False

str | bool

See the component docstring.

torch_device

'auto'

str

See the component docstring.

torch_dtype

'float64'

str

See the component docstring.

graph

Graph-topology features of one subject’s habitat map. Required: (none). Optional: include_single_habitat_graph, include_pairwise_habitat_graph, edge_method, distance_threshold, adjacency_connectivity, adjacency_min_voxels, edge_weight, min_region_voxels, connectivity, erosion_radius, node_method, subdivide_region_voxels, block_size, block_min_coverage, pairwise_include_intra_edges, include_extended_metrics, extended_min_nodes, small_world_nrand, small_world_niter, rich_club_q, graph_null_sampler, graph_null_device. Spec("graph") Registry.create("graph")

Param

Default

Allowed / type

Meaning

include_single_habitat_graph

True

bool

See the component docstring.

include_pairwise_habitat_graph

True

bool

See the component docstring.

edge_method

'min_distance'

‘centroid_distance’ | ‘adjacency’ | ‘min_distance’

See the component docstring.

distance_threshold

5.0

float

See the component docstring.

adjacency_connectivity

'corner'

‘face’ | ‘edge’ | ‘corner’

See the component docstring.

adjacency_min_voxels

10

int

See the component docstring.

edge_weight

'none'

‘none’ | ‘distance’ | ‘inverse_distance’ | ‘contact_voxels’

See the component docstring.

min_region_voxels

1

int

See the component docstring.

connectivity

'full'

‘face’ | ‘full’

See the component docstring.

erosion_radius

0

int

See the component docstring.

node_method

'uniform_grid'

‘uniform_grid’ | ‘component’

See the component docstring.

subdivide_region_voxels

1000

int

See the component docstring.

block_size

8

int

See the component docstring.

block_min_coverage

0.2

float

See the component docstring.

pairwise_include_intra_edges

True

bool

See the component docstring.

include_extended_metrics

True

bool

See the component docstring.

extended_min_nodes

10

int

See the component docstring.

small_world_nrand

100

int

See the component docstring.

small_world_niter

100

int

See the component docstring.

rich_club_q

100

int

See the component docstring.

graph_null_sampler

'analytic'

‘analytic’ | ‘config’ | ‘rewire’

See the component docstring.

graph_null_device

'auto'

str

See the component docstring.

ith_score

ITH score for one subject’s habitat map. Required: (none). Optional: include_auxiliary. Spec("ith_score") Registry.create("ith_score")

Param

Default

Allowed / type

Meaning

include_auxiliary

False

bool

See the component docstring.

msi

Multiregional spatial interaction features of one subject’s habitat map. Required: (none). Optional: (none). Spec("msi") Registry.create("msi")

non_radiomics

Basic spatial features of one subject’s habitat map. Required: (none). Optional: (none). Spec("non_radiomics") Registry.create("non_radiomics")

traditional

PyRadiomics features of the raw image(s) within the whole ROI. Required: (none). Optional: params_file, params, modalities, modality, as_, use_torch_radiomics, torch_device, torch_dtype. Spec("traditional") Registry.create("traditional")

Param

Default

Allowed / type

Meaning

params_file

None

str | None

See the component docstring.

params

None

dict | None

See the component docstring.

modalities

None

Sequence | None

See the component docstring.

modality

None

str | None

See the component docstring.

as_

None

str | None

See the component docstring.

use_torch_radiomics

False

str | bool

See the component docstring.

torch_device

'auto'

str

See the component docstring.

torch_dtype

'float64'

str

See the component docstring.

volume

Voxel counts and volume fractions of every habitat for one subject. Required: (none). Optional: (none). Spec("volume") Registry.create("volume")

whole_habitat

PyRadiomics features of the habitat map treated as the image itself. Required: (none). Optional: params_file, params, use_torch_radiomics, torch_device, torch_dtype. Spec("whole_habitat") Registry.create("whole_habitat")

Param

Default

Allowed / type

Meaning

params_file

None

str | None

See the component docstring.

params

None

dict | None

See the component docstring.

use_torch_radiomics

False

str | bool

See the component docstring.

torch_device

'auto'

str

See the component docstring.

torch_dtype

'float64'

str

See the component docstring.

combiner

average

Average sibling blocks element-wise, optionally with child weights. Required: (none). Optional: weights. Spec("average") Registry.create("average")

Param

Default

Allowed / type

Meaning

weights

None

Mapping | None

Weight per child source label. Weights are normalised to sum to one; children without an entry keep weight 1.0 (before normalisation).

concat

Merge sibling blocks by placing their columns side by side. Required: (none). Optional: (none). Spec("concat") Registry.create("concat")

difference

Element-wise difference of two sibling blocks: first - second. Required: (none). Optional: (none). Spec("difference") Registry.create("difference")

expression

Features defined by restricted arithmetic over sibling block columns. Required: (none). Optional: features, expressions, feature_names, eps. Spec("expression") Registry.create("expression")

Param

Default

Allowed / type

Meaning

features

None

Mapping | None

Mapping of feature name to formula. Mutually exclusive with expressions.

expressions

None

Sequence | None

Ordered formulas when names are not provided up front.

feature_names

None

Sequence | None

Names aligned with expressions; defaults to expr_0, expr_1, …

eps

1e-08

float

Value bound to the name eps inside every formula.

kinetic

Per-unit enhancement slopes across a dynamic contrast series. Required: timestamps. Optional: phases, time_format. Spec("kinetic", {"timestamps": ...}) Registry.create("kinetic", timestamps=...)

Param

Default

Allowed / type

Meaning

timestamps

(required)

str | Mapping

Acquisition times per subject, either as a mapping {subject_id: {phase: "HH-MM-SS"}} for API callers, or a path to the v0.1 timestamp table.

phases

()

Sequence

Phase labels in acquisition order (unenhanced, arterial, portal-venous, delayed). Empty resolves to the merged child column names – for raw children, their modality names.

time_format

'%H-%M-%S'

str

strptime format of the timestamp values.

ratio

Element-wise ratio of two sibling blocks: first / (second + eps). Required: (none). Optional: eps. Spec("ratio") Registry.create("ratio")

Param

Default

Allowed / type

Meaning

eps

1e-08

float

Constant added to the denominator before dividing. Must be non-negative.

weighted_concat

Concatenate sibling blocks after scaling each by a child-specific weight. Required: (none). Optional: weights. Spec("weighted_concat") Registry.create("weighted_concat")

Param

Default

Allowed / type

Meaning

weights

None

Mapping | None

Scale factor per child, keyed by the child’s source label (its as_ alias when set, else its modality). Children without an entry keep weight 1.0.

image_perturbation

bspline_deform

MONAI elastic / B-spline free-form warp of every image and ROI. Required: (none). Optional: sigma_range, magnitude_range, image_mode, mask_mode, padding_mode, device, target_dice, dice_tolerance, control_spacing, mask_only. Spec("bspline_deform") Registry.create("bspline_deform")

Param

Default

Allowed / type

Meaning

sigma_range

(1.5, 3.0)

Sequence

Gaussian smoothing (low, high) of the offset grid, in voxels. Wider sigma gives a smoother warp. Ignored when control_spacing is set.

magnitude_range

(8.0, 12.0)

Sequence

Displacement magnitude (low, high) in voxels. Larger values wrinkle the ROI more.

image_mode

'bilinear'

str | int

Intensity interpolator ("bilinear" / "nearest" or spline order 0–5).

mask_mode

'nearest'

str | int

ROI interpolator ("nearest" recommended for the MONAI path; "bilinear" then rint is a smoother iso-contour on the FFD path).

padding_mode

'reflection'

str

Out-of-grid padding (reflection, border, or zeros).

device

'cpu'

str

Torch device ("cpu" / "cuda"). Default "cpu" is the portable path; pass "cuda" when a GPU is available and the volume fits in memory. Unused on the FFD path.

target_dice

None

float | None

When set, scale one frozen offset field so the Dice between the original and warped ROI is within dice_tolerance of this value. None keeps the random magnitude from magnitude_range.

dice_tolerance

0.02

float

Allowed absolute error on target_dice.

control_spacing

None

float | None

When set, voxels between neighbouring FFD control points (must be > 1). None keeps the MONAI Rand3DElasticd path.

mask_only

False

bool

When True, warp every ROI and leave images untouched (inter-observer contour wobble on a fixed scan). When False, image and mask share one field.

gaussian_noise

Add zero-mean Gaussian noise to every image of a subject. Required: (none). Optional: sigma, noise_method, roi, round_to_int. Spec("gaussian_noise") Registry.create("gaussian_noise")

Param

Default

Allowed / type

Meaning

sigma

None

float | None

Noise standard deviation in intensity units; None estimates it per subject with noise_method (the paper’s choice, MIRP’s behaviour when no level is configured).

noise_method

'chang'

str

"chang" (wavelet estimator) or "roi_std" (standard deviation inside the ROI).

roi

None

str | None

Mask key for roi_std estimation; None uses the subject’s single mask.

round_to_int

False

bool

Round the noisy image to whole numbers, mirroring MIRP’s handling of integer-valued CT (HU) data.

gradient_weighted

Locally grow/shrink ROI boundaries where image gradient is low. Required: (none). Optional: modality, roi, max_radius_voxels, probability. Spec("gradient_weighted") Registry.create("gradient_weighted")

Param

Default

Allowed / type

Meaning

modality

None

str | None

Image modality supplying the gradient-magnitude map; None uses the subject’s first image. The map is normalised to [0, 1] over the ROI bounding region.

roi

None

str | None

Restrict the perturbation to one mask key; None perturbs all masks.

max_radius_voxels

2

int

Neighbourhood radius bounding each local flip.

probability

0.5

float

Base flip probability at zero gradient; effective probability is probability * (1 - gradient).

morphological

Uniformly grow or shrink every ROI (MIRP perturbation_roi_adapt_size). Required: (none). Optional: grow_mm, max_grow_mm, roi, connectivity. Spec("morphological") Registry.create("morphological")

Param

Default

Allowed / type

Meaning

grow_mm

None

float | None

Fixed physical radius in millimetres; positive dilates, negative erodes, zero is a no-op. None samples a signed radius from Uniform(-max_grow_mm, +max_grow_mm) per call.

max_grow_mm

1.0

float

Sampling bound when grow_mm is unset.

roi

None

str | None

Restrict the perturbation to one mask key; None perturbs all masks.

connectivity

1

int

Structuring-element connectivity in {1, 2, 3}; 1 (6-connected) is the MIRP-like default.

rigid

Sub-voxel translation and small-angle rotation in ONE resample. Required: (none). Optional: shift_voxels, shift_fraction, random_signs, angle_degrees, axis, interpolator, random_sign, warp_masks. Spec("rigid") Registry.create("rigid")

Param

Default

Allowed / type

Meaning

shift_voxels

None

Sequence | None

Fixed voxel shift; None uses shift_fraction.

shift_fraction

0.5

float

MIRP perturbation_translation_fraction in [0, 1] (paper-style default 0.5).

random_signs

True

bool

Randomize the sign of each translation axis.

angle_degrees

0.5

float

In-plane rotation in degrees (paper: 0.5).

axis

'z'

str

Rotation axis (paper: "z").

interpolator

'bspline'

str

Intensity interpolator (paper: "bspline").

random_sign

False

bool

Randomize the rotation sense.

warp_masks

True

bool

When True, apply the same rigid move to every ROI. Prior 2024 extraction keeps the original mask (False).

rotation

Rotate image content by a small fixed angle about the image centre. Required: (none). Optional: angle_degrees, axis, interpolator, random_sign, warp_masks. Spec("rotation") Registry.create("rotation")

Param

Default

Allowed / type

Meaning

angle_degrees

0.5

float

Rotation angle in degrees; the paper uses 0.5. Deterministic by design – pass the sign you want.

axis

'z'

str

Axis to rotate around ("x", "y" or "z"; "z" is the axial in-plane axis, the paper’s choice).

interpolator

'bspline'

str

Interpolator for the intensity images ("bspline" is the paper’s choice); masks use nearest neighbour only when warp_masks is True.

random_sign

False

bool

When True, the sign of angle_degrees is drawn as ±1 per call (some MIRP configs randomize the sense of the 0.5° in-plane rotation). The paper’s default is a fixed +0.5 degrees, so this stays False.

warp_masks

True

bool

When True, apply the same rotation to every ROI. Prior 2024 extraction keeps the original mask (False).

slice_extent

Add or remove whole axial slices at the superior/inferior ROI ends. Required: (none). Optional: grow_slices, shrink_slices, max_slices, roi. Spec("slice_extent") Registry.create("slice_extent")

Param

Default

Allowed / type

Meaning

grow_slices

0

int

Slices to append at each occupied end (copy of the nearest occupied slice’s labels).

shrink_slices

0

int

Occupied slices to remove at each end.

max_slices

0

int

Bound for random per-end counts; 0 uses the fixed counts.

roi

None

str | None

Restrict the perturbation to one mask key; None perturbs all masks.

translation

Translate image content by a (random) sub-voxel shift. Required: (none). Optional: shift_voxels, max_shift_voxels, interpolator, shift_fraction, random_signs, warp_masks. Spec("translation") Registry.create("translation")

Param

Default

Allowed / type

Meaning

shift_voxels

None

Sequence | None

Fixed shift in voxel units, SimpleITK (x, y, z) order; None defers to shift_fraction or random sampling.

max_shift_voxels

1.0

float

Sampling bound when neither fixed shift is set.

interpolator

'bspline'

str

Interpolator for the intensity images ("bspline" is the paper’s choice); masks use nearest neighbour only when warp_masks is True.

shift_fraction

None

float | None

MIRP-style fraction of a voxel in [0, 1]. When set (and shift_voxels is unset), the shift is ±fraction on each axis (signs random if random_signs).

random_signs

True

bool

When using shift_fraction, randomize the sign of each axis (MIRP interpolates at a shifted grid; the direction of the shift is not anatomically privileged).

warp_masks

True

bool

When True, apply the same translation to every ROI. Prior 2024 extraction keeps the original mask (False).

pooling

pool

Marker component that declares the subject→cohort fan-in watershed. Required: (none). Optional: (none). Spec("pool") Registry.create("pool")

preprocessor

adaptive_histogram_equalization

Contrast-limited adaptive histogram equalization (SimpleITK). Required: (none). Optional: alpha, beta, radius. Spec("adaptive_histogram_equalization") Registry.create("adaptive_histogram_equalization")

Param

Default

Allowed / type

Meaning

alpha

0.3

float

See the component docstring.

beta

0.3

float

See the component docstring.

radius

5

int | tuple[int, int, int]

See the component docstring.

histogram_standardization

Nyúl histogram standardization onto a standard intensity scale. Required: (none). Optional: percentiles, target_min, target_max, mask_key. Spec("histogram_standardization") Registry.create("histogram_standardization")

Param

Default

Allowed / type

Meaning

percentiles

None

list[float] | None

See the component docstring.

target_min

0.0

float

See the component docstring.

target_max

100.0

float

See the component docstring.

mask_key

None

str | None

See the component docstring.

n4_correction

N4 bias-field correction (SimpleITK). Required: (none). Optional: num_fitting_levels, num_iterations, convergence_threshold, shrink_factor, mask_name. Spec("n4_correction") Registry.create("n4_correction")

Param

Default

Allowed / type

Meaning

num_fitting_levels

4

int

See the component docstring.

num_iterations

None

list[int] | None

See the component docstring.

convergence_threshold

0.001

float

See the component docstring.

shrink_factor

4

int

See the component docstring.

mask_name

None

str | None

See the component docstring.

registration

Register moving modalities onto a fixed reference (ANTs / SitK / elastix). Required: fixed_image. Optional: backend, type_of_transform, metric, optimizer, use_mask, replace_by_fixed_image_mask, mask_key, elastix_parameter_files, elastix_path, transformix_path, elastix_threads, elastix_parameter_overrides, number_of_histogram_bins, metric_sampling_percentage, shrink_factors_per_level, smoothing_sigmas_per_level, learning_rate, number_of_iterations, bspline_mesh_size, bspline_order. Spec("registration", {"fixed_image": ...}) Registry.create("registration", fixed_image=...)

Param

Default

Allowed / type

Meaning

fixed_image

(required)

str

See the component docstring.

backend

'ants'

str

See the component docstring.

type_of_transform

'SyN'

str

See the component docstring.

metric

'MI'

str

See the component docstring.

optimizer

None

str | None

See the component docstring.

use_mask

False

bool

See the component docstring.

replace_by_fixed_image_mask

True

bool

See the component docstring.

mask_key

''

str

See the component docstring.

elastix_parameter_files

None

str | None

See the component docstring.

elastix_path

None

str | None

See the component docstring.

transformix_path

None

str | None

See the component docstring.

elastix_threads

0

int

See the component docstring.

elastix_parameter_overrides

None

dict | None

See the component docstring.

number_of_histogram_bins

50

int

See the component docstring.

metric_sampling_percentage

0.01

float

See the component docstring.

shrink_factors_per_level

None

list[int] | None

See the component docstring.

smoothing_sigmas_per_level

None

list[float] | None

See the component docstring.

learning_rate

1.0

float

See the component docstring.

number_of_iterations

100

int

See the component docstring.

bspline_mesh_size

8

int

See the component docstring.

bspline_order

3

int

See the component docstring.

reorientation

Reorient images (and masks) to a canonical DICOM orientation. Required: (none). Optional: target_orientation, mode. Spec("reorientation") Registry.create("reorientation")

Param

Default

Allowed / type

Meaning

target_orientation

'LPS'

str

See the component docstring.

mode

'closest'

str

See the component docstring.

resample

Resample images (and matching masks) to a target voxel spacing. Required: (none). Optional: target_spacing, img_mode, padding_mode, align_corners. Spec("resample") Registry.create("resample")

Param

Default

Allowed / type

Meaning

target_spacing

(1.0, 1.0, 1.0)

Sequence

See the component docstring.

img_mode

'bilinear'

str

See the component docstring.

padding_mode

'border'

str

See the component docstring.

align_corners

False

bool

See the component docstring.

zscore_normalization

Z-score intensity normalization (float32; signed values preserved). Required: (none). Optional: only_inmask, mask_key, clip_values. Spec("zscore_normalization") Registry.create("zscore_normalization")

Param

Default

Allowed / type

Meaning

only_inmask

False

bool

See the component docstring.

mask_key

None

str | None

See the component docstring.

clip_values

None

tuple[float, float] | None

See the component docstring.

table_preprocessor

binning

K-bins discretisation of every feature to ordinal bin indices. Required: (none). Optional: n_bins, bin_strategy, across_features. Spec("binning") Registry.create("binning")

Param

Default

Allowed / type

Meaning

n_bins

10

int

See the component docstring.

bin_strategy

'uniform'

str

See the component docstring.

across_features

False

bool

See the component docstring.

correlation_filter

Greedily drop redundant, highly correlated feature columns. Required: (none). Optional: corr_threshold, corr_method. Spec("correlation_filter") Registry.create("correlation_filter")

Param

Default

Allowed / type

Meaning

corr_threshold

0.95

float

See the component docstring.

corr_method

'spearman'

str

See the component docstring.

l2

Scale each table row to unit Euclidean length. Required: (none). Optional: (none). Spec("l2") Registry.create("l2")

log

Log transform log(x - min_train + 1) of every feature. Required: (none). Optional: across_features. Spec("log") Registry.create("log")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

maxabs

Scale every feature by its training max absolute value. Required: (none). Optional: across_features. Spec("maxabs") Registry.create("maxabs")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

minmax

Min-max scaling of every feature to [0, 1]. Required: (none). Optional: across_features. Spec("minmax") Registry.create("minmax")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

precise_correlation_filter

Prior 2024 Spearman screen on a modelling table. Required: (none). Optional: corr_threshold, p_threshold. Spec("precise_correlation_filter") Registry.create("precise_correlation_filter")

Param

Default

Allowed / type

Meaning

corr_threshold

0.7

float

See the component docstring.

p_threshold

0.05

float

See the component docstring.

quantile

Map each feature onto a uniform or normal distribution by percentile rank. Required: (none). Optional: across_features, n_quantiles, output_distribution. Spec("quantile") Registry.create("quantile")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

n_quantiles

1000

int

See the component docstring.

output_distribution

'uniform'

str

See the component docstring.

robust

Robust scaling of every feature by training median and IQR. Required: (none). Optional: across_features. Spec("robust") Registry.create("robust")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

variance_filter

Drop feature columns whose training variance is at/below a threshold. Required: (none). Optional: variance_threshold, keep_at_least_one. Spec("variance_filter") Registry.create("variance_filter")

Param

Default

Allowed / type

Meaning

variance_threshold

0.0

float

See the component docstring.

keep_at_least_one

True

bool

See the component docstring.

winsorize

Clip extreme feature values at training quantiles. Required: (none). Optional: winsor_limits, across_features. Spec("winsorize") Registry.create("winsorize")

Param

Default

Allowed / type

Meaning

winsor_limits

(0.05, 0.05)

tuple[float, float]

See the component docstring.

across_features

False

bool

See the component docstring.

zscore

Z-score standardisation of every feature. Required: (none). Optional: across_features. Spec("zscore") Registry.create("zscore")

Param

Default

Allowed / type

Meaning

across_features

False

bool

See the component docstring.

feature_selector

anova

Univariate ANOVA F-value selection against the outcome. Required: (none). Optional: p_threshold, n_features_to_select. Spec("anova") Registry.create("anova")

Param

Default

Allowed / type

Meaning

p_threshold

0.05

float

See the component docstring.

n_features_to_select

None

int | float | NoneType

See the component docstring.

chi2

Univariate chi-square selection against a categorical outcome. Required: (none). Optional: p_threshold, n_features_to_select. Spec("chi2") Registry.create("chi2")

Param

Default

Allowed / type

Meaning

p_threshold

0.05

float

See the component docstring.

n_features_to_select

None

int | float | NoneType

See the component docstring.

correlation

Unsupervised greedy removal of highly correlated features. Required: (none). Optional: threshold, method. Spec("correlation") Registry.create("correlation")

Param

Default

Allowed / type

Meaning

threshold

0.8

float

See the component docstring.

method

'spearman'

str

See the component docstring.

icc

Test-retest stability selection by intraclass correlation coefficient. Required: (none). Optional: threshold, icc_type. Spec("icc") Registry.create("icc")

Param

Default

Allowed / type

Meaning

threshold

0.75

float

See the component docstring.

icc_type

'icc3'

str

See the component docstring.

icc_precomputed

Stability selection from a PRECOMPUTED ICC results JSON. Required: icc_results_path, groups. Optional: threshold, metric. Spec("icc_precomputed", {"icc_results_path": ..., "groups": ...}) Registry.create("icc_precomputed", icc_results_path=..., groups=...)

Param

Default

Allowed / type

Meaning

icc_results_path

(required)

str

See the component docstring.

groups

(required)

Sequence

See the component docstring.

threshold

0.75

float

See the component docstring.

metric

None

str | None

See the component docstring.

lasso

L1-penalised (Lasso) selection with cross-validated penalty. Required: (none). Optional: cv, n_alphas, alphas, n_jobs, estimator_params. Spec("lasso") Registry.create("lasso")

Param

Default

Allowed / type

Meaning

cv

10

int

Cross-validation folds for LassoCV.

n_alphas

100

int

Number of alpha values along the regularisation path.

alphas

None

list[float] | None

Explicit alpha grid (overrides n_alphas when given).

n_jobs

-1

int

Parallel jobs for the cross-validation.

estimator_params

None

Mapping | None

Extra keyword arguments forwarded verbatim to LassoCV, for vendor parameters HABIT does not declare. They are validated against the LassoCV signature at fit time and recorded in the spec fingerprint.

mrmr

Minimum-redundancy-maximum-relevance (MRMR) selection. Required: (none). Optional: n_features, task_type. Spec("mrmr") Registry.create("mrmr")

Param

Default

Allowed / type

Meaning

n_features

10

int

See the component docstring.

task_type

'classification'

str

See the component docstring.

rfecv

Recursive feature elimination with cross-validation (RFECV). Required: (none). Optional: estimator, step, cv, scoring, min_features_to_select, n_jobs. Spec("rfecv") Registry.create("rfecv")

Param

Default

Allowed / type

Meaning

estimator

'RandomForestClassifier'

str

See the component docstring.

step

1

int

See the component docstring.

cv

5

int

See the component docstring.

scoring

'roc_auc'

str

See the component docstring.

min_features_to_select

1

int

See the component docstring.

n_jobs

-1

int

See the component docstring.

statistical_test

Two-group univariate selection with automatic test choice. Required: (none). Optional: p_threshold, n_features_to_select, normality_test_threshold, force_test. Spec("statistical_test") Registry.create("statistical_test")

Param

Default

Allowed / type

Meaning

p_threshold

0.05

float

See the component docstring.

n_features_to_select

None

int | float | NoneType

See the component docstring.

normality_test_threshold

0.05

float

See the component docstring.

force_test

None

str | None

See the component docstring.

stepwise

Stepwise logistic-regression selection (forward, backward or both). Required: (none). Optional: direction, threshold_in, threshold_out, criterion, verbose. Spec("stepwise") Registry.create("stepwise")

Param

Default

Allowed / type

Meaning

direction

'backward'

str

See the component docstring.

threshold_in

0.05

float

See the component docstring.

threshold_out

0.05

float

See the component docstring.

criterion

'aic'

str

See the component docstring.

verbose

False

bool

See the component docstring.

univariate_cox

Univariate Cox proportional-hazards selection against a survival outcome. Required: (none). Optional: p_threshold, n_features_to_select. Spec("univariate_cox") Registry.create("univariate_cox")

Param

Default

Allowed / type

Meaning

p_threshold

0.05

float

See the component docstring.

n_features_to_select

None

int | float | NoneType

See the component docstring.

univariate_logistic

Per-feature logistic regression against the outcome. Required: (none). Optional: alpha, verbose. Spec("univariate_logistic") Registry.create("univariate_logistic")

Param

Default

Allowed / type

Meaning

alpha

0.05

float

See the component docstring.

verbose

True

bool

See the component docstring.

variance

Unsupervised variance-based selection. Required: (none). Optional: threshold, top_k, top_percent, keep_at_least_one. Spec("variance") Registry.create("variance")

Param

Default

Allowed / type

Meaning

threshold

0.0

float

See the component docstring.

top_k

None

int | None

See the component docstring.

top_percent

None

float | None

See the component docstring.

keep_at_least_one

False

bool

See the component docstring.

vif

Iterative variance-inflation-factor (VIF) pruning of multicollinearity. Required: (none). Optional: max_vif. Spec("vif") Registry.create("vif")

Param

Default

Allowed / type

Meaning

max_vif

10.0

float

See the component docstring.

classifier

AdaBoost

Adaptive boosting of decision stumps (sklearn AdaBoostClassifier). Required: (none). Optional: n_estimators, learning_rate. Spec("AdaBoost") Registry.create("AdaBoost")

Param

Default

Allowed / type

Meaning

n_estimators

50

int

See the component docstring.

learning_rate

1.0

float

See the component docstring.

AutoGluonTabular

AutoML classifier wrapping AutoGluon’s TabularPredictor. Required: (none). Optional: feature_importance, label, predictor, fit. Spec("AutoGluonTabular") Registry.create("AutoGluonTabular")

Param

Default

Allowed / type

Meaning

feature_importance

'auto'

str

See the component docstring.

label

None

str | None

See the component docstring.

predictor

None

dict | None

See the component docstring.

fit

None

dict | None

See the component docstring.

BernoulliNB

Bernoulli naive Bayes (sklearn BernoulliNB; deterministic). Required: (none). Optional: alpha, binarize, fit_prior, class_prior. Spec("BernoulliNB") Registry.create("BernoulliNB")

Param

Default

Allowed / type

Meaning

alpha

1.0

float

See the component docstring.

binarize

0.0

float | None

See the component docstring.

fit_prior

True

bool

See the component docstring.

class_prior

None

list[float] | None

See the component docstring.

DecisionTree

Single CART decision tree (sklearn DecisionTreeClassifier). Required: (none). Optional: criterion, splitter, max_depth, min_samples_split, min_samples_leaf, max_features, class_weight. Spec("DecisionTree") Registry.create("DecisionTree")

Param

Default

Allowed / type

Meaning

criterion

'gini'

str

See the component docstring.

splitter

'best'

str

See the component docstring.

max_depth

None

int | None

See the component docstring.

min_samples_split

2

int

See the component docstring.

min_samples_leaf

1

int

See the component docstring.

max_features

None

str | float | int | NoneType

See the component docstring.

class_weight

None

str | dict | NoneType

See the component docstring.

GaussianNB

Gaussian naive Bayes (sklearn GaussianNB; deterministic). Required: (none). Optional: priors, var_smoothing. Spec("GaussianNB") Registry.create("GaussianNB")

Param

Default

Allowed / type

Meaning

priors

None

list[float] | None

See the component docstring.

var_smoothing

1e-09

float

See the component docstring.

GradientBoosting

Stage-wise additive tree ensemble (sklearn GradientBoostingClassifier). Required: (none). Optional: loss, learning_rate, n_estimators, subsample, criterion, min_samples_split, min_samples_leaf, max_depth, max_features. Spec("GradientBoosting") Registry.create("GradientBoosting")

Param

Default

Allowed / type

Meaning

loss

'log_loss'

str

See the component docstring.

learning_rate

0.1

float

See the component docstring.

n_estimators

100

int

See the component docstring.

subsample

1.0

float

See the component docstring.

criterion

'friedman_mse'

str

See the component docstring.

min_samples_split

2

int

See the component docstring.

min_samples_leaf

1

int

See the component docstring.

max_depth

3

int

See the component docstring.

max_features

None

str | float | int | NoneType

See the component docstring.

KNN

k-nearest-neighbours classifier (sklearn KNeighborsClassifier). Required: (none). Optional: n_neighbors, weights, algorithm, leaf_size, p, metric, n_jobs. Spec("KNN") Registry.create("KNN")

Param

Default

Allowed / type

Meaning

n_neighbors

5

int

See the component docstring.

weights

'uniform'

str

See the component docstring.

algorithm

'auto'

str

See the component docstring.

leaf_size

30

int

See the component docstring.

p

2

int

See the component docstring.

metric

'minkowski'

str

See the component docstring.

n_jobs

-1

int

See the component docstring.

LogisticRegression

Penalised logistic regression (sklearn LogisticRegression). Required: (none). Optional: C, penalty, solver, max_iter, class_weight, estimator_params. Spec("LogisticRegression") Registry.create("LogisticRegression")

Param

Default

Allowed / type

Meaning

C

1.0

float

Inverse regularisation strength.

penalty

'l2'

str

Penalty norm.

solver

'liblinear'

str

Optimisation algorithm.

max_iter

1000

int

Maximum solver iterations.

class_weight

None

str | dict | NoneType

Optional class rebalancing.

estimator_params

None

Mapping | None

Extra keyword arguments forwarded verbatim to the sklearn estimator, for vendor parameters HABIT does not declare. They are validated against the estimator signature at fit time and recorded in the spec fingerprint.

MLP

Multi-layer perceptron classifier (sklearn MLPClassifier). Required: (none). Optional: hidden_layer_sizes, activation, solver, alpha, batch_size, learning_rate, learning_rate_init, max_iter, shuffle, early_stopping, validation_fraction. Spec("MLP") Registry.create("MLP")

Param

Default

Allowed / type

Meaning

hidden_layer_sizes

(100,)

tuple[int, Ellipsis]

See the component docstring.

activation

'relu'

str

See the component docstring.

solver

'adam'

str

See the component docstring.

alpha

0.0001

float

See the component docstring.

batch_size

'auto'

str | int

See the component docstring.

learning_rate

'constant'

str

See the component docstring.

learning_rate_init

0.001

float

See the component docstring.

max_iter

200

int

See the component docstring.

shuffle

True

bool

See the component docstring.

early_stopping

False

bool

See the component docstring.

validation_fraction

0.1

float

See the component docstring.

MultinomialNB

Multinomial naive Bayes (sklearn MultinomialNB; deterministic). Required: (none). Optional: alpha, fit_prior, class_prior. Spec("MultinomialNB") Registry.create("MultinomialNB")

Param

Default

Allowed / type

Meaning

alpha

1.0

float

See the component docstring.

fit_prior

True

bool

See the component docstring.

class_prior

None

list[float] | None

See the component docstring.

RandomForest

Bagged decision-tree ensemble (sklearn RandomForestClassifier). Required: (none). Optional: n_estimators, max_depth, min_samples_split, min_samples_leaf, max_features, bootstrap, class_weight. Spec("RandomForest") Registry.create("RandomForest")

Param

Default

Allowed / type

Meaning

n_estimators

100

int

See the component docstring.

max_depth

None

int | None

See the component docstring.

min_samples_split

2

int

See the component docstring.

min_samples_leaf

1

int

See the component docstring.

max_features

'sqrt'

str | float | int | NoneType

See the component docstring.

bootstrap

True

bool

See the component docstring.

class_weight

None

str | dict | NoneType

See the component docstring.

SVC

Kernel support-vector classifier (sklearn SVC). Required: (none). Optional: C, kernel, gamma, class_weight, probability. Spec("SVC") Registry.create("SVC")

Param

Default

Allowed / type

Meaning

C

1.0

float

See the component docstring.

kernel

'rbf'

str

See the component docstring.

gamma

'scale'

str | float

See the component docstring.

class_weight

None

str | dict | NoneType

See the component docstring.

probability

True

bool

See the component docstring.

SVM

Linear support-vector classifier (sklearn LinearSVC). Required: (none). Optional: C, class_weight, max_iter. Spec("SVM") Registry.create("SVM")

Param

Default

Allowed / type

Meaning

C

1.0

float

See the component docstring.

class_weight

None

str | dict | NoneType

See the component docstring.

max_iter

1000

int

See the component docstring.

XGBoost

Gradient-boosted trees from the xgboost library (XGBClassifier). Required: (none). Optional: n_estimators, max_depth, learning_rate, subsample, colsample_bytree, objective, eval_metric. Spec("XGBoost") Registry.create("XGBoost")

Param

Default

Allowed / type

Meaning

n_estimators

100

int

See the component docstring.

max_depth

3

int

See the component docstring.

learning_rate

0.1

float

See the component docstring.

subsample

0.8

float

See the component docstring.

colsample_bytree

0.8

float

See the component docstring.

objective

'binary:logistic'

str

See the component docstring.

eval_metric

'logloss'

str

See the component docstring.

metric

accuracy

Fraction of exactly matching labels. Required: (none). Optional: (none). Spec("accuracy") Registry.create("accuracy")

auc

ROC AUC over the positive-class scores. Required: (none). Optional: (none). Spec("auc") Registry.create("auc")

f1_score

Harmonic mean of PPV and sensitivity over one shared confusion matrix. Required: (none). Optional: (none). Spec("f1_score") Registry.create("f1_score")

hosmer_lemeshow_p_value

Hosmer-Lemeshow calibration p-value (binary outcomes only). Required: (none). Optional: n_groups. Spec("hosmer_lemeshow_p_value") Registry.create("hosmer_lemeshow_p_value")

Param

Default

Allowed / type

Meaning

n_groups

10

int

See the component docstring.

npv

Negative predictive value; macro per-class mean when multi-class. Required: (none). Optional: (none). Spec("npv") Registry.create("npv")

ppv

Positive predictive value (precision); macro mean when multi-class. Required: (none). Optional: (none). Spec("ppv") Registry.create("ppv")

sensitivity

Sensitivity (recall, true positive rate); macro mean when multi-class. Required: (none). Optional: (none). Spec("sensitivity") Registry.create("sensitivity")

specificity

Specificity (true negative rate); macro mean when multi-class. Required: (none). Optional: (none). Spec("specificity") Registry.create("specificity")

spiegelhalter_z_p_value

Spiegelhalter Z-test calibration p-value (binary outcomes only). Required: (none). Optional: (none). Spec("spiegelhalter_z_p_value") Registry.create("spiegelhalter_z_p_value")

Types

  • PluginInfo — name, domain, implementation, provider

  • PluginLoadReport — result of load_plugins

Registering a third-party plugin

External packages make components discoverable by declaring HABIT’s entry point groups in their own packaging metadata. The group name is habit. followed by the domain string; v1.0 domains are the snake_case singular protocol names listed above (older plural group names remain honoured for legacy factories). HABIT itself declares no empty groups — setuptools strips them — the authoritative list is habit/api/plugins.py::_ENTRY_POINT_GROUPS.

In the plugin’s pyproject.toml:

[project.entry-points."habit.supervoxelizer"]
my_slic_variant = "my_package.my_module:MySupervoxelizer"

[project.entry-points."habit.voxel_feature_extractor"]
dce_hemodynamics = "my_package.features:register"

The registered object must implement the matching protocol from the capability package (for example Supervoxelizer) and expose a spec (see Spec, RunPolicy, and YAML isomorphism). For voxel_feature_extractor, the entry point commonly points at a callable that performs @VoxelFeatureExtractorRegistry.register(...) (same pattern as other domains). After pip install of the plugin package, load_plugins() surfaces it and list_plugins("supervoxelizer") / list_plugins("voxel_feature_extractor") report provider="<distribution>".

Runnable DIY example: Custom features.