Requirements
- Python 3.9+
- Docker
Step 1: Install the Featureform CLI
Step 2: Start Featureform
To start Featureform, we can run:--include_clickhouse
flag i.e.
Step 3: Set the Featureform Host
Step 4: Apply Definitions
Featureform definitions can be stored as both a local file and URL. Multiple files can be applied at the same time. We’ll set the--insecure
flag since we’re using an unencrypted endpoint on the container.
Step 5: Dashboard and Serving
The dashboard is available at localhost In the dashboard, you should be able to see that 2 Sources, 1 Feature, 1 Label, and 1 Training Set has been created. You can also check the status of the training set with:Step 5: Teardown
To teardown the quickstart run:How Does It Work?
Now that we have everything running, we’ll walk through what was done to create the training set and feature.Apply
If we download the definitions.py file, we can see what Featureform is doing when we runfeatureform apply
.
First we register the Postgres and Redis containers as providers so Featureform is aware of them.
definitions.py
definitions.py
definitions.py
ff.entity
decorator will use the lowercased class name as the entity name. The class attributes avg_transactions
and fraudulent
will be registered as a feature and label, respectively, associated with the user
entity. Indexing into the sources (e.g. average_user_transaction
) with a [["<ENTITY COLUMN>", "<FEATURE/LABEL COLUMN>"]]
, returns the required parameters to the Feature
and Label
registration classes.
When registering more than one variant, we can use the Variants
registration class:
definitions.py
Serving
We can serve single features from Redis with the Serving Client. Thefeatures()
method takes the name of the feature
and an entity that we want the value for.
serving.py
Training
We can serve a training dataset from Postgres with the Serving Client as well. This example takes the name of the training set and returns 25 rows of the training set.training.py