hsml.sklearn.signature #
create_model #
create_model(
name: str,
version: int | None = None,
metrics: dict | None = None,
description: str | None = None,
input_example: pandas.DataFrame
| pandas.Series
| numpy.ndarray
| list
| None = None,
model_schema: ModelSchema | None = None,
feature_view: FeatureView | None = None,
training_dataset_version: int | None = None,
) -> Model
Create an SkLearn model metadata object.
Lazy
This method is lazy and does not persist any metadata or uploads model artifacts in the model registry on its own. To save the model object and the model artifacts, call the save() method with a local file path to the directory containing the model artifacts.
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the model to create. TYPE: |
version | Optionally version of the model to create, defaults to TYPE: |
metrics | Optionally a dictionary with model evaluation metrics (e.g., accuracy, MAE) TYPE: |
description | Optionally a string describing the model, defaults to empty string TYPE: |
input_example | Optionally an input example that represents a single input for the model, defaults to TYPE: |
model_schema | Optionally a model schema for the model inputs and/or outputs. TYPE: |
feature_view | Optionally a feature view object returned by querying the feature store. If the feature view is not provided, the model will not have access to provenance. TYPE: |
training_dataset_version | Optionally a training dataset version. If training dataset version is not provided, but the feature view is provided, the training dataset version used will be the last accessed training dataset of the feature view, within the code/notebook that reads the feature view and training dataset and then creates the model. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
Model | The model metadata object. |