hsfs.feature #
Feature #
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.
use_fully_qualified_name property writable #
use_fully_qualified_name: bool
Use fully qualified name for the feature when generating dataframes for training/batch data.
type property writable #
type: str | None
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.
online_type property writable #
online_type: str | None
Data type of the feature in the online feature store.
primary property writable #
primary: bool
Whether the feature is part of the primary key of the feature group.
foreign property writable #
foreign: bool
Whether the feature is part of the foreign key of the feature group.
partition property writable #
partition: bool
Whether the feature is part of the partition key of the feature group.
hudi_precombine_key property writable #
hudi_precombine_key: bool
Whether the feature is part of the hudi precombine key of the feature group.
default_value property writable #
default_value: str | None
Default value of the feature as string, if the feature was appended to the feature group.
feature_group_id property #
feature_group_id: int | None
ID of the feature group to which this feature belongs.
on_demand property writable #
on_demand: bool
Whether the feature is a on-demand feature computed using on-demand transformation functions.
is_complex #
is_complex() -> bool
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()
| RETURNS | DESCRIPTION |
|---|---|
bool | True if the feature type is a complex type, False otherwise. |
contains #
Deprecated
contains is deprecated and will be removed in a future release of Hopsworks. Instead of it, consider using Feature.isin.
Construct a filter similar to SQL's IN operator.
| PARAMETER | DESCRIPTION |
|---|---|
other | A single feature value or a list of feature values. |
| RETURNS | DESCRIPTION |
|---|---|
filter.Filter | A filter that leaves only the feature values also contained in |