Find and inspect feature sets
List feature sets in a workspace
The list method does not return feature sets directly. Instead, it returns an iterator which obtains the feature sets lazily.
- Python
workspace = client.workspaces.list(name="my_workspace")[0]
workspace.feature_sets.list(query=None, advanced_search_options=None)
The query and advancedSearchOption arguments are optional and specify which feature sets
should be returned. By default, no filtering options are specified.
To filter feature sets by name, description or tags please use query parameter.
- Python
workspace.feature_sets.list(query="My feature")
The advancedSearchOption allows to filter feature sets by feature name, description or tags.
To provide the 'advancedSearchOption' in your requests, follow these steps:
- Python
from h2o_featurestore.core.search_operator import SearchOperator
from h2o_featurestore.core.search_field import SearchField
from h2o_featurestore import AdvancedSearchOption
search_options = [AdvancedSearchOption(search_operator=SearchOperator.SEARCH_OPERATOR_LIKE, search_field=SearchField.SEARCH_FIELD_FEATURE_NAME, search_value="super feature")]
workspace.feature_sets.list(advanced_search_options=search_options)
Both parameters could be used together.
You can also list all major versions of the feature set:
- Python
fs.major_versions()
This call shows all major versions of the feature set (the current and previous ones).
You can also list all versions of the feature set:
- Python
fs.list_versions()
This call shows all versions of the feature set (the current and previous ones).
Listing feature sets across workspaces
workspace.feature_sets.list() is scoped to a single workspace. To search
several workspaces at once, or every workspace you can access, use
client.workspaces.list_feature_sets().
- Python
# List feature sets across specific workspaces
for fs in client.workspaces.list_feature_sets(
workspace_names=["workspaces/<uid_A>", "workspaces/<uid_B>"]
):
print(fs.name)
# List across all accessible workspaces
for fs in client.workspaces.list_feature_sets():
print(fs.name)
Workspaces are identified by their resource name (workspaces/<uid>), not their display name. You can construct this from a workspace object: f"workspaces/{workspace.uid}". Like the workspace-scoped list(), this method
returns a lazy iterator (i.e., you can iterate over them without loading everything into memory at once).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspace_names | list[str] | No | Workspace resource names to search (e.g. "workspaces/<uid>"). Searches all accessible workspaces if omitted. |
Returns a generator of FeatureSet objects.
Feature sets found this way can be used as parents of a derived feature set even when they live in another workspace — see Joining feature sets from different workspaces.
Obtaining a feature set
- Python
workspace = client.workspaces.list(name="my_workspace")[0]
fs = workspace.feature_sets.get_by_name("feature_set_name", version=None)
If the version is not specified, the latest version of the feature set is returned.
It is also possible to obtain different version of a feature set from some feature set instance as:
- Python
fs = feature_set.get_version("2.1")
Commonly used properties
The following table lists the most commonly accessed properties. For the full set of updatable fields, see Update feature set metadata.
| Property | Type | Description |
|---|---|---|
parent | str | Workspace resource name that owns this feature set (e.g. workspaces/<uid>). |
name | str | Display name of the feature set. |
version | str | Current version (e.g. 1.0). |
description | str | Description. |
tags | list[str] | User-defined tags. |
primary_key | list[str] | Primary key column names. |
time_travel_column | str | None | Name of the time travel column, or None if one was not specified at registration (Feature Store creates a virtual one in that case). |
deprecated | bool | Whether the feature set is deprecated. |
features | dict | Map of feature name to Feature object. |
Previewing data
You can preview up to a maximum of 100 rows and 50 features.
- Python
fs.get_preview()
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai