Feature Lookup

class databricks.ml_features.entities.feature_lookup.FeatureLookup(table_name: str, lookup_key: Union[str, List[str]], *, feature_names: Union[str, List[str], None] = None, rename_outputs: Optional[Dict[str, str]] = None, timestamp_lookup_key: Optional[str] = None, lookback_window: Optional[datetime.timedelta] = None, **kwargs)

Bases: databricks.ml_features_common.entities._feature_store_object._FeatureStoreObject

Note

Aliases: databricks.feature_engineering.entities.feature_lookup.FeatureLookup, databricks.feature_store.entities.feature_lookup.FeatureLookup

Value class used to specify a feature to use in a TrainingSet.

Parameters:
  • table_name – Feature table name.
  • lookup_key – Key to use when joining this feature table with the DataFrame passed to create_training_set(). The lookup_key must be the columns in the DataFrame passed to create_training_set(). The type and order of lookup_key columns in that DataFrame must match the primary key of the feature table referenced in this FeatureLookup.
  • feature_names – A single feature name, a list of feature names, or None to lookup all features (excluding primary keys) in the feature table at the time that the training set is created. If your model requires primary keys as features, you can declare them as independent FeatureLookups.
  • rename_outputs – If provided, renames features in the TrainingSet returned by of create_training_set().
  • timestamp_lookup_key

    Key to use when performing point-in-time lookup on this feature table with the DataFrame passed to create_training_set(). The timestamp_lookup_key must be the columns in the DataFrame passed to create_training_set(). The type of timestamp_lookup_key columns in that DataFrame must match the type of the timestamp key of the feature table referenced in this FeatureLookup.

    Note

    Experimental: This argument may change or be removed in a future release without warning.

  • lookback_window – The lookback window to use when performing point-in-time lookup on the feature table with the dataframe passed to create_training_set(). Feature Store will retrieve the latest feature value prior to the timestamp specified in the dataframe’s timestamp_lookup_key and within the lookback_window, or null if no such feature value exists. When set to 0, only exact matches from the feature table are returned.
  • feature_name – Feature name. Deprecated. Use feature_names.
  • output_name – If provided, rename this feature in the output of create_training_set(). Deprecated. Use rename_outputs.
__init__(table_name: str, lookup_key: Union[str, List[str]], *, feature_names: Union[str, List[str], None] = None, rename_outputs: Optional[Dict[str, str]] = None, timestamp_lookup_key: Optional[str] = None, lookback_window: Optional[datetime.timedelta] = None, **kwargs)

Initialize a FeatureLookup object. See class documentation.

table_name

The table name to use in this FeatureLookup.

lookup_key

The lookup key(s) to use in this FeatureLookup.

feature_name

The feature name to use in this FeatureLookup. Deprecated. Use feature_names.

feature_names

The feature names to use in this FeatureLookup.

output_name

The output name to use in this FeatureLookup. Deprecated. Use feature_names.

lookback_window

A lookback window applied only for point-in-time lookups.