coco_pipe.decoding.registry¶
Central registry for decoding estimators (classifiers, regressors, and FMs). This allows instantiating models from string names in configuration files, avoiding circular imports and simplifying the config layer.
Usage¶
>>> from coco_pipe.decoding.registry import register_estimator, get_estimator_cls
>>>
>>> @register_estimator("MyModel")
>>> class MyModel: ...
>>>
>>> cls = get_estimator_cls("MyModel")
Attributes¶
Functions¶
Populate _LAZY_MODULES from 'coco_pipe.estimators' entry points. |
|
Walk through the 'coco_pipe.decoding' subpackage and import all modules. |
|
|
Decorator to register an estimator class under a specific name. |
|
Retrieve an estimator class by name. |
|
Return a copy of the current registry. |
Module Contents¶
- coco_pipe.decoding.registry._ESTIMATOR_REGISTRY: Dict[str, Type]¶
- coco_pipe.decoding.registry._LAZY_MODULES¶
- coco_pipe.decoding.registry._discover_entry_points()[source]¶
Populate _LAZY_MODULES from ‘coco_pipe.estimators’ entry points. This allows plugins to register estimators without modifying code.
- coco_pipe.decoding.registry._discover_internal_modules()[source]¶
Walk through the ‘coco_pipe.decoding’ subpackage and import all modules. This triggers the @register_estimator decorators.
- coco_pipe.decoding.registry.register_estimator(name: str) Callable[[Type], Type][source]¶
Decorator to register an estimator class under a specific name.
- Parameters:
name (str) – The unique alias for the estimator (e.g., “RandomForestClassifier”).