Feature#
Feature#
hsfs.feature.Feature(
name,
type=None,
description=None,
primary=False,
partition=False,
hudi_precombine_key=False,
online_type=None,
default_value=None,
feature_group_id=None,
feature_group=None,
**kwargs
)
Metadata object representing a feature in a feature group in the Feature Store.
See Training Dataset Feature for the feature representation of training dataset schemas.
Properties#
default_value#
Default value of the feature as string, if the feature was appended to the feature group.
description#
Description of the feature.
feature_group_id#
hudi_precombine_key#
Whether the feature is part of the hudi precombine key of the feature group.
name#
Name of the feature.
online_type#
Data type of the feature in the online feature store.
partition#
Whether the feature is part of the partition key of the feature group.
primary#
Whether the feature is part of the primary key of the feature group.
type#
Data type of the feature in the offline feature store.
Not a Python type
This type property is not to be confused with Python types. The type property represents the actual data type of the feature in the feature store.
Methods#
contains#
Feature.contains(other)
Deprecated
contains
method is deprecated. Use isin
instead.
from_response_json#
Feature.from_response_json(json_dict)
is_complex#
Feature.is_complex()
Returns true if the feature has a complex type.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
selected_feature = fg.get_feature("min_temp")
selected_feature.is_complex()
isin#
Feature.isin(other)
json#
Feature.json()
like#
Feature.like(other)
to_dict#
Feature.to_dict()
Get structured info about specific Feature in python dictionary format.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
selected_feature = fg.get_feature("min_temp")
selected_feature.to_dict()