Feature Store#
The public API allows you to:
list feature groups
dataikuapi.dss.feature_store.DSSFeatureStore.list_feature_groups()
check if a dataset is a feature group
dataikuapi.dss.dataset.DSSDatasetSettings.is_feature_group()
set/unset a dataset as a feature group:
dataikuapi.dss.dataset.DSSDatasetSettings.set_feature_group()
See Feature Store for more information.
Listing feature groups#
import dataiku
# if using API from inside DSS
client = dataiku.api_client()
feature_store = client.get_feature_store()
feature_groups = feature_store.list_feature_groups()
for feature_group in feature_groups:
print("{}".format(feature_group.id))
Note
This will only display feature groups of projects on which the user has at least read permission
Note
Because of indexing latency, you have have to wait a few seconds before newly defined feature groups are visible
(Un)setting a dataset as a Feature Group#
import dataiku
# if using API from inside DSS
client = dataiku.api_client()
project = client.get_project('PROJECT_ID')
ds = project.get_dataset('DATASET_ID')
ds_settings = ds.get_settings()
# pass False to undefine as Feature Group
ds_settings.set_feature_group(True)
ds_settings.save()
Collecting feature groups with a specific meaning#
import dataiku
# if using API from inside DSS
client = dataiku.api_client()
# Define the meaning ID to look for
meaning="doublemeaning"
result = set()
# List feature group
feature_store = client.get_feature_store()
feature_groups = feature_store.list_feature_groups()
feature_groups = [ feature_group.id for feature_group in feature_groups ]
# Search for meaning
for f in feature_groups:
data = f.split('.')
project = client.get_project(data[0])
dataset = project.get_dataset(data[1])
schema = dataset.get_schema()
for col in schema['columns']:
if ('meaning' in col) and (col['meaning'] == meaning):
result.add(f)
print(result)
Documenting a feature store#
There are several ways to document a feature group, acting on the underlying dataset:
Reference documentation#
A handle on the Feature Store. |
|
An item in a list of feature groups. |