Automatic feature lookup with Databricks Model Serving

Model Serving can automatically look up feature values from published online stores or from online tables. For more details about creating and working with online tables, see Use online tables for real-time feature serving.

Requirements

  • The model must have been logged with FeatureEngineeringClient.log_model (for Feature Engineering in Unity Catalog) or FeatureStoreClient.log_model (for Workspace Feature Store, requires v0.3.5 and above).

  • For third-party online stores, the online store must be published with read-only credentials.

Note

You can publish the feature table at any time prior to model deployment, including after model training.

Automatic feature lookup

Databricks Model Serving supports automatic feature lookup from these online stores:

Automatic feature lookup is supported for the following data types:

  • IntegerType

  • FloatType

  • BooleanType

  • StringType

  • DoubleType

  • LongType

  • TimestampType

  • DateType

  • ShortType

  • DecimalType

  • ArrayType

  • MapType

Override feature values in online model scoring

All features required by the model (logged with FeatureEngineeringClient.log_model or FeatureStoreClient.log_model) are automatically looked up from online stores for model scoring. To override feature values when scoring a model using a REST API with Model Serving include the feature values as a part of the API payload.

Note

The new feature values must conform to the feature’s data type as expected by the underlying model.

Notebook examples: Unity Catalog

With Databricks Runtime 13.3 LTS and above, any Delta table in Unity Catalog with a primary key can be used as a feature table. When you use a table registered in Unity Catalog as a feature table, all Unity Catalog capabilities are automatically available to the feature table.

The following notebook illustrates how to publish features to online tables for real-time serving and automated feature lookup.

Online tables demo notebook

Open notebook in new tab

This example notebook illustrates how to publish features to an online store and then serve a trained model that automatically looks up features from the online store.

Third-party online store example notebook (Unity Catalog)

Open notebook in new tab

Notebook examples: Workspace Feature Store

This example notebook illustrates how to publish features to an online store and then serve a trained model that automatically looks up features from the online store.

Third-party online store example notebook (workspace feature store)

Open notebook in new tab