Skip to content

Feature#

[source]

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#

[source]

default_value#

Default value of the feature as string, if the feature was appended to the feature group.


[source]

description#

Description of the feature.


[source]

feature_group_id#


[source]

hudi_precombine_key#

Whether the feature is part of the hudi precombine key of the feature group.


[source]

name#

Name of the feature.


[source]

online_type#

Data type of the feature in the online feature store.


[source]

partition#

Whether the feature is part of the partition key of the feature group.


[source]

primary#

Whether the feature is part of the primary key of the feature group.


[source]

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#

[source]

contains#

Feature.contains(other)

Deprecated

contains method is deprecated. Use isin instead.


[source]

from_response_json#

Feature.from_response_json(json_dict)

[source]

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()

[source]

isin#

Feature.isin(other)

[source]

json#

Feature.json()

[source]

like#

Feature.like(other)

[source]

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()