tadkit.utils package
Submodules
tadkit.utils.decomposable_tadlearner module
- class tadkit.utils.decomposable_tadlearner.DecomposableTADLearner(**params)[source]
Bases:
TADLearnerAbstract base class combining a Preprocessor and a TADLearner.
- Learner: Type[TADLearner]
- Preprocessor: Type
- fit(X: ndarray | list | DataFrame, y: ndarray | list | DataFrame | None = None) DecomposableTADLearner[source]
- score_samples(X: ndarray | list | DataFrame) ndarray | list | DataFrame[source]
The measure of normality of an observation according to the fitted model. Scikit-learn compatible.
- Parameters:
X ({array-like, sparse matrix} of shape (n_samples, n_features)) – The input samples.
- Returns:
scores – The anomaly score of the input samples. The lower, the more abnormal.
- Return type:
ndarray of shape (n_samples,)
- tadkit.utils.decomposable_tadlearner.decomposable_tadlearner_factory(Preprocessor: Type, Learner: Type[TADLearner], name: str | None = None) Type[TADLearner][source]
Create a TADLearner class combining a preprocessor and a learner with a proper __init__ signature.
tadkit.utils.param_spec module
- tadkit.utils.param_spec.anchor_type_to_default(entry: Dict[str, Any]) Dict[str, Any][source]
If parameter has multiple possible types or categories, restrict to the one matching the default’s type.
- tadkit.utils.param_spec.determine_widget(entry: Dict[str, Any]) Dict[str, Any][source]
Infer a UI widget and arguments from parameter metadata.
- tadkit.utils.param_spec.params_from_class(cls) Dict[str, Dict[str, Any]][source]
Combine default values, docstrings, and sklearn parameter constraints into a unified param specification dictionary.
- Returns:
- param_name -> {
‘default’: Any, ‘type’: type or str, ‘bounds’: {‘min’:…, ‘max’:…, ‘closed’:…}, ‘options’: list[str] or None, ‘allow_none’: bool, ‘description’: str
}
- Return type:
Dict[str, Dict[str, Any]]
tadkit.utils.render_widgets_from_params module
tadkit.utils.ui module
- class tadkit.utils.ui.WidgetFactory(frontend='ipywidgets')[source]
Bases:
objectFactory for creating UI widgets or no-UI representations.
- WIDGET_STYLE = {'description_width': 'initial'}