You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We then use Docker Compose to spin up a local Kafka cluster and automatically publish events to it.
33
-
- This leverages a script (in `kafka_demo/`) that creates a topic, reads from `feature_repo/data/driver_stats.parquet`, generates newer timestamps, and emits them to the topic.
34
-
35
-
```
36
-
docker-compose up
37
-
```
38
-
39
-
### Setting up Feast
40
-
41
-
Install Feast using pip
42
-
43
-
```
44
-
pip install 'feast[redis]'
45
-
```
46
-
47
-
We have already set up a feature repository in [feature_repo/](feature_repo/).
48
-
49
-
Deploy the feature store by running `apply` from within the `feature_repo/` folder
50
-
```
51
-
cd feature_repo/
52
-
feast apply
53
-
```
54
-
55
-
Output:
56
-
```
57
-
Created entity driver
58
-
Created feature view driver_hourly_stats
59
-
Created feature view driver_daily_features
60
-
Created on demand feature view transformed_conv_rate
61
-
Created feature service convrate_plus100
62
-
63
-
Deploying infrastructure for driver_hourly_stats
64
-
Deploying infrastructure for driver_daily_features
65
-
```
66
-
67
-
Next we load features into the online store using the `materialize-incremental` command. This command will load the
68
-
latest feature values from a data source into the online store.
69
-
70
-
```
71
-
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S")
72
-
feast materialize-incremental $CURRENT_TIME
73
-
```
74
-
75
-
Output:
76
-
```
77
-
Materializing 2 feature views to 2022-04-28 12:38:01-04:00 into the redis online store.
78
-
79
-
driver_hourly_stats from 1748-07-13 16:38:03-04:56:02 to 2022-04-28 12:38:01-04:00:
# Module 1: Serving fresh online features with Feast, Kafka, Redis
2
+
3
+
In module 1, we focus on building some test features and go through common flows in Feast
4
+
5
+
-**Data sources**: Kafka + File source
6
+
-**Online store**: Redis
7
+
-**Use case**: Predicting churn for drivers
8
+
- Batch scoring via offline store
9
+
- Real time scoring via online store
10
+
11
+
## Setup
12
+
13
+
### Docker + Kafka + Redis
14
+
First, we install Feast with Redis support:
15
+
```
16
+
pip install "feast[redis]"
17
+
```
18
+
19
+
We then use Docker Compose to spin up a local Kafka cluster and automatically publish events to it.
20
+
- This leverages a script (in `kafka_demo/`) that creates a topic, reads from `feature_repo/data/driver_stats.parquet`, generates newer timestamps, and emits them to the topic.
21
+
22
+
```
23
+
docker-compose up
24
+
```
25
+
26
+
### Setting up Feast
27
+
28
+
Install Feast using pip
29
+
30
+
```
31
+
pip install 'feast[redis]'
32
+
```
33
+
34
+
We have already set up a feature repository in [feature_repo/](feature_repo/).
35
+
36
+
Deploy the feature store by running `apply` from within the `feature_repo/` folder
37
+
```
38
+
cd feature_repo/
39
+
feast apply
40
+
```
41
+
42
+
Output:
43
+
```
44
+
Created entity driver
45
+
Created feature view driver_hourly_stats
46
+
Created feature view driver_daily_features
47
+
Created on demand feature view transformed_conv_rate
48
+
Created feature service convrate_plus100
49
+
50
+
Deploying infrastructure for driver_hourly_stats
51
+
Deploying infrastructure for driver_daily_features
52
+
```
53
+
54
+
Next we load features into the online store using the `materialize-incremental` command. This command will load the
55
+
latest feature values from a data source into the online store.
56
+
57
+
```
58
+
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S")
59
+
feast materialize-incremental $CURRENT_TIME
60
+
```
61
+
62
+
Output:
63
+
```
64
+
Materializing 2 feature views to 2022-04-28 12:38:01-04:00 into the redis online store.
65
+
66
+
driver_hourly_stats from 1748-07-13 16:38:03-04:56:02 to 2022-04-28 12:38:01-04:00:
0 commit comments