Skip to content

Commit e271a00

Browse files
authored
Update featurestore.md
1 parent 7762edb commit e271a00

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

featurestore.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,23 @@ The `add_point_in_time_feature` API method uses the aggregation_key_features to
149149
A slightly different example shows how to calculate the click through rate from the last 100 events in the activity log.
150150
```python
151151
purchases_feature_group.add_point_in_time_feature(
152-
'recent_events_ctr',
152+
'recent_clicks',
153153
aggregation_keys=['user_id', 'site_id'],
154154
timestamp_key='purchase_timestamp',
155155
history_table_name='activity_log',
156156
historical_timestamp_key='activity_timestamp',
157157
lookback_count=100,
158-
expression='SUM(IF(event_type = "click", 1, 0)) / SUM(IF(event_type="impression", 1, 0))'
159-
)
158+
expression='SUM(IF(event_type = "click", 1, 0))'
159+
)
160+
purchases_feature_group.add_point_in_time_feature(
161+
'recent_views',
162+
aggregation_keys=['user_id', 'site_id'],
163+
timestamp_key='purchase_timestamp',
164+
history_table_name='activity_log',
165+
historical_timestamp_key='activity_timestamp',
166+
lookback_count=100,
167+
expression='SUM(IF(event_type = "view", 1, 0))'
168+
)
160169
```
161170

162171

0 commit comments

Comments
 (0)