Skip to content

Commit 00166d0

Browse files
authored
Update featurestore.md
1 parent 3c99b32 commit 00166d0

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

featurestore.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ def construct_fg_from_api():
122122

123123
For this type of no arguments function, can use the following snippet to create a python function feature group.
124124
````python
125-
feature_group = client.create_feature_group_from_function(table_name='joined_events_data', function_source_code=fg_code, function_name='construct_fg_from_api')
125+
feature_group = client.create_feature_group_from_function(
126+
table_name='joined_events_data',
127+
function_source_code=fg_code,
128+
function_name='construct_fg_from_api'
129+
)
126130
````
127131

128132
### Point In Time Features
@@ -144,13 +148,15 @@ The `add_point_in_time_feature` API method uses the aggregation_key_features to
144148

145149
A slightly different example shows how to calculate the click through rate from the last 100 events in the activity log.
146150
```python
147-
purchases_feature_group.add_point_in_time_feature('recent_events_ctr',
148-
aggregation_keys=['user_id', 'site_id'],
149-
timestamp_key='purchase_timestamp',
150-
history_table_name='activity_log',
151-
historical_timestamp_key='activity_timestamp',
152-
lookback_count=100,
153-
expression='SUM(IF(event_type = "click", 1, 0)) / SUM(IF(event_type="impression", 1, 0))')
151+
purchases_feature_group.add_point_in_time_feature(
152+
'recent_events_ctr',
153+
aggregation_keys=['user_id', 'site_id'],
154+
timestamp_key='purchase_timestamp',
155+
history_table_name='activity_log',
156+
historical_timestamp_key='activity_timestamp',
157+
lookback_count=100,
158+
expression='SUM(IF(event_type = "click", 1, 0)) / SUM(IF(event_type="impression", 1, 0))'
159+
)
154160
```
155161

156162

0 commit comments

Comments
 (0)