sportslabkit.vector_model.sklearn#
Overview#
A specialized subclass of BaseVectorModel for scikit-learn pipelines. |
Classes#
- class sportslabkit.vector_model.sklearn.SklearnVectorModel(model_path: str = '', input_vector_size: int | None = None, output_vector_size: int | None = None)[source]#
Bases:
sportslabkit.vector_model.base.BaseVectorModelA specialized subclass of BaseVectorModel for scikit-learn pipelines.
This class is designed to facilitate the use of scikit-learn pipelines as vector-based models within the SportsLabKit ecosystem. It overrides the abstract methods from BaseVectorModel to provide implementations tailored for scikit-learn pipelines.
- model#
The loaded scikit-learn pipeline model. None if the model is not loaded.
- Type:
Pipeline | None
Overview
Members
- forward(inputs: sportslabkit.types.Vector, **kwargs: Any) sportslabkit.types.Vector[source]#
Implement the forward pass specific to scikit-learn pipelines.
This method takes a vector input and passes it through the scikit-learn pipeline’s predict method. Additional keyword arguments can be passed to the predict method via **kwargs.
- Parameters:
inputs (Vector) – The input vector, which should match the expected input shape of the pipeline.
**kwargs (Any) – Additional keyword arguments to pass to the pipeline’s predict method.
- Returns:
The output vector from the pipeline’s predict method.
- Return type:
Vector
- Raises:
ValueError – If the model attribute is None, indicating that the model has not been loaded.