vertebrae.extractors.sklearn
Scikit-learn transformer and pipeline extractors.
Classes
Wrap a scikit-learn transformer or pipeline as an extractor. |
Module Contents
- class vertebrae.extractors.sklearn.SklearnExtractor(name, pipeline, already_fitted=False, extractor_type='unsupervised_fitted', max_dense_bytes=2000000000, allow_sparse=False, cache_identity=None)[source]
Wrap a scikit-learn transformer or pipeline as an extractor.
- Parameters:
name (str) – User-facing extractor name.
pipeline (Any) – Object exposing fit, transform, or fit_transform.
already_fitted (bool) – Whether to skip fitting and call only transform.
extractor_type (str) – Extractor family metadata.
max_dense_bytes (int) – Maximum allowed sparse-to-dense conversion size.
allow_sparse (bool) – Whether sparse pipeline outputs should be preserved.
cache_identity (Optional[str])
- fit(X, y=None)[source]
Fit the wrapped scikit-learn object when needed.
- Parameters:
X (Any) – Input samples.
y (Any) – Optional labels.
- Returns:
This extractor.
- Return type:
- transform(X)[source]
Transform inputs with the wrapped scikit-learn object.
- Parameters:
X (Any) – Input samples.
- Returns:
Dense or sparse numeric embedding matrix.
- Return type:
numpy.ndarray