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 tocreate_training_set()
. Thelookup_key
must be the columns in the DataFrame passed tocreate_training_set()
. The type and order oflookup_key
columns in that DataFrame must match the primary key of the feature table referenced in thisFeatureLookup
. - 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 ofcreate_training_set()
. - timestamp_lookup_key –
Key to use when performing point-in-time lookup on this feature table with the
DataFrame
passed tocreate_training_set()
. Thetimestamp_lookup_key
must be the columns in the DataFrame passed tocreate_training_set()
. The type oftimestamp_lookup_key
columns in that DataFrame must match the type of the timestamp key of the feature table referenced in thisFeatureLookup
.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’stimestamp_lookup_key
and within thelookback_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. Userename_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.
-
feature_name
The feature name to use in this FeatureLookup. Deprecated. Use
feature_names
.
-
output_name
The output name to use in this FeatureLookup. Deprecated. Use
feature_names
.