Pre-processing and post-processing with models¶
This topic explains how to create models, log them to the Snowflake Model Registry, and deploy them, using a number of model types and scenarios as examples. These include:
- In-memory scikit-learn models and pipelines.
- Your own custom models.
- More than one model.
In-memory scikit-learn models and pipelines¶
Snowflake ML allows seamless integration of in-memory scikit-learn models into the Model Registry by using keyword
arguments with ModelContext class. Below is an example of passing an in-memory scikit-learn model as a keyword
argument to model context and calling it in a custom model class.
Using scikit-learn pipelines with Snowflake ML¶
Below is an example showing how to use scikit-learn pipelines within Snowflake ML. This involves preprocessing
steps such as scaling or imputing, followed by a predictive model, all managed within a custom model class using the
ModelContext.
Using your own models¶
The following example uses your own model as a custom model.
Using more than one model¶
Below is a custom model that combines multiple models and uses a configuration file to apply bias when generating predictions.
Note
model1 and model2 are objects of any type of model natively supported by the registry. feature_preproc
is a scikit-learn pipeline object.