-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfeatures.py
45 lines (41 loc) · 1005 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from datetime import timedelta
import pandas as pd
from feast import (
FeatureView,
Field,
)
from feast.types import (
Float32,
Float64,
UnixTimestamp
)
from data_sources import *
from entities import *
driver_hourly_stats_view = FeatureView(
name="driver_hourly_stats",
description="Hourly features",
entities=[driver],
ttl=timedelta(seconds=8640000000),
schema=[
Field(name="conv_rate", dtype=Float32),
Field(name="acc_rate", dtype=Float32),
],
online=True,
source=driver_stats,
tags={"production": "True"},
owner="test2@gmail.com",
)
driver_daily_miles_view = FeatureView(
name="driver_daily_miles",
description="Daily miles",
entities=[driver],
ttl=timedelta(seconds=8640000000),
schema=[
Field(name="day", dtype=UnixTimestamp),
Field(name="miles_driven", dtype=Float64),
],
online=True,
source=driver_stats,
tags={"production": "True"},
owner="jary@redhat.com",
)