coco_pipe.decoding.registry#
Central engine for resolving, registering, and lazy-loading decoding estimators. This allows configurations to refer to models by name without triggering eager imports of heavyweight dependencies.
Exceptions#
Raised when an estimator is not found in the registry. |
Functions#
|
Decorator to register a custom estimator class under a specific name. |
|
Register or replace an estimator spec in the global specs registry. |
|
Retrieve an estimator class by name, triggering lazy loading if needed. |
|
Return the typed estimator spec for a given name. |
|
Return machine-readable capability metadata for a given estimator. |
Return capability metadata for all registered estimators. |
|
Return all registered estimator specs. |
|
|
Return the FoundationModelSpec for a registered foundation model. |
Return a list of dicts describing all registered foundation models. |
|
|
Resolve a hydrated EstimatorSpec from a model configuration. |
|
Resolve lightweight capabilities derived from |
|
Return feature-selector capabilities for a given name. |
Module Contents#
- exception coco_pipe.decoding.registry.EstimatorNotFoundError#
Bases:
KeyError,ValueErrorRaised when an estimator is not found in the registry.
- coco_pipe.decoding.registry.register_estimator(name)#
Decorator to register a custom estimator class under a specific name.
- Parameters:
name (str) – The unique name to register the estimator under.
- Returns:
A decorator that adds the class to the internal registry.
- Return type:
Callable[[Type], Type]
- coco_pipe.decoding.registry.register_estimator_spec(spec)#
Register or replace an estimator spec in the global specs registry.
This allows the execution engine to support new model types by name, defining their capabilities, required input formats, and importance extraction logic.
- Parameters:
spec (EstimatorSpec) – The typed specification object for the estimator.
- Returns:
The registered specification object.
- Return type:
EstimatorSpec
See also
get_estimator_specRetrieve a registered specification.
- coco_pipe.decoding.registry.get_estimator_cls(name)#
Retrieve an estimator class by name, triggering lazy loading if needed.
- Parameters:
name (str) – The canonical name of the estimator (e.g., ‘LogisticRegression’).
- Returns:
The uninstantiated estimator class.
- Return type:
Type
- Raises:
EstimatorNotFoundError – If the estimator is unknown.
ImportError – If the underlying module cannot be imported.
Examples
>>> from coco_pipe.decoding.registry import get_estimator_cls >>> cls = get_estimator_cls("LogisticRegression")
See also
get_estimator_specRetrieve the metadata for an estimator.
- coco_pipe.decoding.registry.get_estimator_spec(name)#
Return the typed estimator spec for a given name.
- Parameters:
name (str) – The canonical name of the estimator (e.g., ‘LogisticRegression’).
- Returns:
The registered specification object.
- Return type:
EstimatorSpec
- Raises:
ValueError – If no specification is registered for the given name.
See also
get_capabilitiesRetrieve derived lightweight capabilities.
- coco_pipe.decoding.registry.get_capabilities(name)#
Return machine-readable capability metadata for a given estimator.
- Parameters:
name (str) – The canonical name of the estimator.
- Returns:
Lightweight metadata summary for validation.
- Return type:
EstimatorCapabilities
- coco_pipe.decoding.registry.list_capabilities()#
Return capability metadata for all registered estimators.
- Returns:
A dictionary mapping estimator names to their capability objects.
- Return type:
Dict[str, EstimatorCapabilities]
See also
get_capabilitiesRetrieve capabilities for a single estimator.
- coco_pipe.decoding.registry.list_estimator_specs()#
Return all registered estimator specs.
- Returns:
A dictionary mapping estimator names to their full specification objects.
- Return type:
Dict[str, EstimatorSpec]
See also
get_estimator_specRetrieve a single estimator specification.
- coco_pipe.decoding.registry.get_foundation_model_spec(model_key)#
Return the FoundationModelSpec for a registered foundation model.
- coco_pipe.decoding.registry.list_foundation_models()#
Return a list of dicts describing all registered foundation models.
- coco_pipe.decoding.registry.resolve_estimator_spec(config)#
Resolve a hydrated EstimatorSpec from a model configuration.
This function handles polymorphic model types (Foundation, Temporal, Neural) and applies runtime parameter fixups based on the user’s specific configuration (e.g., handling SVC probability flags).
- Parameters:
config (Any) – A configuration object (typically a Pydantic model) containing the ‘kind’ and specific estimator parameters.
- Returns:
A hydrated spec object containing accurate flags for the training engine.
- Return type:
EstimatorSpec
Examples
>>> from coco_pipe.decoding.configs import LogisticRegressionConfig >>> from coco_pipe.decoding.registry import resolve_estimator_spec >>> config = LogisticRegressionConfig() >>> spec = resolve_estimator_spec(config)
See also
resolve_estimator_capabilitiesLightweight capability summary.
- coco_pipe.decoding.registry.resolve_estimator_capabilities(config)#
Resolve lightweight capabilities derived from
resolve_estimator_spec.This is a convenience wrapper that first resolves the full spec (handling polymorphism and runtime fixups) and then converts it to the capability summary used by the engine for validation.
- Parameters:
config (Any) – The model configuration object.
- Returns:
The resolved capability metadata.
- Return type:
EstimatorCapabilities
See also
resolve_estimator_specThe underlying spec resolution logic.
- coco_pipe.decoding.registry.get_selector_capabilities(method)#
Return feature-selector capabilities for a given name.
- Parameters:
method (str) – The name of the feature selection method (e.g., ‘k_best’, ‘sfs’).
- Returns:
The registered capability metadata for the selector.
- Return type:
SelectorCapabilities
- Raises:
ValueError – If the method name is not found in the SELECTOR_CAPABILITIES registry.