-
Notifications
You must be signed in to change notification settings - Fork 1
/
features.py
27 lines (24 loc) · 995 Bytes
/
features.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from datetime import timedelta
from feast import Entity, Feature, FeatureView, RedshiftSource, ValueType
transaction = Entity(name="transactionid")
transaction_source = RedshiftSource(
query=("SELECT * FROM spectrum.transaction_features"),
event_timestamp_column="event_timestamp",
created_timestamp_column="created_timestamp",
)
transaction_features = FeatureView(
name="transaction_features",
entities=["transactionid"],
ttl=timedelta(days=30),
features=[
Feature(name="productcd", dtype=ValueType.STRING),
Feature(name="transactionamt", dtype=ValueType.DOUBLE),
Feature(name="p_emaildomain", dtype=ValueType.STRING),
Feature(name="r_emaildomain", dtype=ValueType.STRING),
Feature(name="card4", dtype=ValueType.STRING),
Feature(name="m1", dtype=ValueType.STRING),
Feature(name="m2", dtype=ValueType.STRING),
Feature(name="m3", dtype=ValueType.STRING),
],
batch_source=transaction_source,
)