You create and publish features inside a project workspace.
-
In your workspace, click File Changes to see the location of the mounted Git repository where feature definitions are stored, marked with a Feature-Store tag.
-
In your Python code, define a feature by creating a feature view.
-
Under File Changes, click Review & Publish Features to make your features available to other Domino users.
To use the feature store in a workspace, the execution must run in an environment with the required Python packages installed. The following environments have the required packages installed:
-
Domino Standard Environment
-
Domino Spark Environment
-
Domino FUSE Environment
-
Domino Dask Environment
If you are using a custom environment and the required packages are not installed there, you can add these to the Dockerfile instructions:
RUN pip install --user feast[snowflake,aws,gcp]==0.26.0
RUN pip install --user dominodatalab-data==5.5.0
Important
|
You must replace the placeholder {x.y.z} with the compatible version of your Domino deployment. Refer to all released packages.
|
For additional details about how to customize an environment, see the following page on how to Use Dockerfile instructions.
To define a feature, you create a Feast-specific entity called a feature view, which is a semantic grouping of features.
To create your feature view, define it in a Python file and save it inside the feature_repo
folder of the centralized Git repository.
This is an example of a feature view:
# NOTE: This is not a runnable code snippet. Please refer to the links below for more guidance.
driver_stats_fv = FeatureView(
name="driver_stats_fv",
ttl=Duration(seconds=86400 * 2),
entities=["driver_id"],
features=[
Feature(name="conv_rate", dtype=ValueType.FLOAT),
Feature(name="acc_rate", dtype=ValueType.FLOAT),
Feature(name="avg_daily_trips", dtype=ValueType.FLOAT)
],
batch_source=file_source
)
For more guidance on creating feature views, see the quickstart guide and Feast’s feature view documentation and code examples.
To make a feature available globally within the Domino feature store, you can publish it.
-
Under File Changes, click Pull to pull any updates into your local workspace and resolve any merge conflicts.
-
Click Review & Publish Features and select the feature view files that you want to push to the centralized Git repository.
-
Click Sync & Publish Features.
The result is as follows:
-
The selected files are pushed into the Git repository.
-
The feature views are synced to the Feast repository (meaning that
feast apply
runs, registering the feature views into theregistry.db
file generated within the data folder). -
The feature views are updated in the Domino global registry.
Now you can see your feature at Data > Feature Store, inside your project or globally.
Note
| You need to pull the feature store Git repository to get the latest changes after publishing features. |
The syncing performed above is executed through a script that runs as a job. In the case of errors, an error toast is displayed and the failed job details are included in the job logs. Common causes of errors include Git credential issues, offline store credential problems, and Feast code problems.
-
To check for errors in your Feast code, open a terminal, change the current directory to the mounted Feast git repository folder, and run the
feast apply
command. If the error is related to Feast code, you’ll see a stack trace to help you debug. Address the error and click the Review & Publish Features button in the workspace to publish the changes. -
For other issues, navigate to the project feature store page and rerun the job by clicking the link in the banner at the top of the page. This banner only appears if the last sync job failed.
-
For credential issues:
-
Update your Git credentials in Account Settings > Git Credentials.
-
Update your offline and online store credentials in Account Settings > User Environment Variables.
-
Syncs (including rerun syncs) always run on the most updated version of the code available in the Domino feature store.
-
Discover and reuse features that are available in the Domino feature store.
-
Try the Feature store quickstart.