@@ -122,7 +122,11 @@ def construct_fg_from_api():
122
122
123
123
For this type of no arguments function, can use the following snippet to create a python function feature group.
124
124
```` 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
+ )
126
130
````
127
131
128
132
### Point In Time Features
@@ -144,13 +148,15 @@ The `add_point_in_time_feature` API method uses the aggregation_key_features to
144
148
145
149
A slightly different example shows how to calculate the click through rate from the last 100 events in the activity log.
146
150
``` 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
+ )
154
160
```
155
161
156
162
0 commit comments