Skip to content

Commit ae47f63

Browse files
committed
adding documentation for the parameters transform and on-demand features
1 parent d29fbc8 commit ae47f63

File tree

4 files changed

+76
-7
lines changed

4 files changed

+76
-7
lines changed

docs/user_guides/fs/feature_group/on_demand_transformations.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,18 @@ The `get_feature_vectors` function retrieves multiple feature vectors using a li
144144
)
145145
```
146146

147-
#### Retrieving untransformed feature vector
147+
#### Retrieving feature vector without on-demand features
148148

149-
The `get_feature_vector` and `get_feature_vectors` can also return untransformed features vector without applying model-dependent transformations that contains on-demand features by setting the parameter `transform` to `False`.
149+
The `get_feature_vector` and `get_feature_vectors` methods can return untransformed feature vectors without on-demand features by disabling model-dependent transformations and excluding on-demand features. To achieve this, set the parameters `transform` and `on_demand_features` to `False`.
150150

151151
=== "Python"
152152
!!! example "Returning untransformed feature vectors"
153153
```python
154154
untransformed_feature_vector = feature_view.get_feature_vector(
155-
entry={"id": 1}, transform=False
155+
entry={"id": 1}, transform=False, on_demand_features=False
156156
)
157157
untransformed_feature_vectors = feature_view.get_feature_vectors(
158-
entry=[{"id": 1}, {"id": 2}], transform=False
158+
entry=[{"id": 1}, {"id": 2}], transform=False, on_demand_features=False
159159
)
160160
```
161161

@@ -170,7 +170,7 @@ The `request_parameter` in this case, can be a list of dictionaries that specifi
170170
```python
171171
# Specify request parameters for each serving key.
172172
untransformed_feature_vector = feature_view.get_feature_vector(
173-
entry={"id": 1}, transform=False
173+
entry={"id": 1}, transform=False, on_demand_features=False
174174
)
175175

176176
# re-compute and add on-demand features to the feature vector
@@ -187,7 +187,7 @@ The `request_parameter` in this case, can be a list of dictionaries that specifi
187187

188188
# Specify request parameters for each serving key.
189189
untransformed_feature_vectors = feature_view.get_feature_vectors(
190-
entry=[{"id": 1}, {"id": 2}], transform=False
190+
entry=[{"id": 1}, {"id": 2}], transform=False, on_demand_features=False
191191
)
192192

193193
# re-compute and add on-demand features to the feature vectors - Specify unique request parameter for each feature vector
@@ -228,7 +228,7 @@ On-demand transformation functions can also be accessed and executed as normal f
228228
```python
229229
# Specify request parameters for each serving key.
230230
feature_vector = feature_view.get_feature_vector(
231-
entry={"id": 1}, transform=False, return_type="pandas"
231+
entry={"id": 1}, transform=False, on_demand_features=False, return_type="pandas"
232232
)
233233

234234
# Applying model dependent transformations

docs/user_guides/fs/feature_view/batch-data.md

+11
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ feature_view.init_batch_scoring(training_dataset_version=1)
5555

5656
It is important to note that in addition to the filters defined in feature view, [extra filters](./training-data.md#Extra-filters) will be applied if they are defined in the given training dataset version.
5757

58+
## Retrieving untransformed batch data
59+
60+
The `get_batch_data` function by default returns the batch data with model-dependent transformations applied. However it can also return untransformed batch data without applying model-dependent transformations but contains on-demand features by setting the parameter `transform` to `False`.
61+
62+
=== "Python"
63+
!!! example "Returning untransformed batch data"
64+
```python
65+
# Fetching untransformed batch data.
66+
untransformed_batch_data = feature_view.get_batch_data(transform=False)
67+
```
68+
5869

5970
## Passing Context Variables to Transformation Functions
6071
After [defining a transformation function using a context variable](../transformation_functions.md#passing-context-variables-to-transformation-function), you can pass the necessary context variables through the `transformation_context` parameter when fetching batch data.

docs/user_guides/fs/feature_view/feature-vectors.md

+35
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,41 @@ You can also use the parameter to provide values for all the features which are
191191
)
192192
```
193193

194+
## Retrieving untransformed feature vectors
195+
196+
By default, the `get_feature_vector` and `get_feature_vectors` functions return transformed feature vectors, which has model-dependent transformations applied and includes on-demand features.
197+
198+
However, you can retrieve the untransformed feature vectors without applying model-dependent transformations while still including on-demand features by setting the `transform` parameter to False.
199+
200+
=== "Python"
201+
!!! example "Returning untransformed feature vectors"
202+
```python
203+
# Fetching untransformed feature vector.
204+
untransformed_feature_vector = feature_view.get_feature_vector(
205+
entry={"id": 1}, transform=False
206+
)
207+
208+
# Fetching untransformed feature vectors.
209+
untransformed_feature_vectors = feature_view.get_feature_vectors(
210+
entry=[{"id": 1}, {"id": 2}], transform=False
211+
)
212+
```
213+
214+
## Retrieving feature vector without on-demand features
215+
216+
The `get_feature_vector` and `get_feature_vectors` methods can also return untransformed feature vectors without on-demand features by disabling model-dependent transformations and excluding on-demand features. To achieve this, set the parameters `transform` and `on_demand_features` to `False`.
217+
218+
=== "Python"
219+
!!! example "Returning untransformed feature vectors"
220+
```python
221+
untransformed_feature_vector = feature_view.get_feature_vector(
222+
entry={"id": 1}, transform=False, on_demand_features=False
223+
)
224+
untransformed_feature_vectors = feature_view.get_feature_vectors(
225+
entry=[{"id": 1}, {"id": 2}], transform=False, on_demand_features=False
226+
)
227+
```
228+
194229
## Passing Context Variables to Transformation Functions
195230
After [defining a transformation function using a context variable](../transformation_functions.md#passing-context-variables-to-transformation-function), you can pass the required context variables using the `transformation_context` parameter when fetching the feature vectors.
196231

docs/user_guides/fs/feature_view/model-dependent-transformations.md

+23
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,26 @@ Model-dependent transformation functions can also be manually applied to a featu
129129
encoded_feature_vector = fv.transform(feature_vector)
130130
```
131131

132+
#### Retrieving untransformed feature vector and batch inference data
133+
134+
The `get_feature_vector`, `get_feature_vectors`, and `get_batch_data` methods can return untransformed feature vectors and batch data without applying model-dependent transformations while still including on-demand features. To achieve this, set the `transform` parameter to False.
135+
136+
=== "Python"
137+
!!! example "Returning untransformed feature vectors and batch data."
138+
```python
139+
# Fetching untransformed feature vector.
140+
untransformed_feature_vector = feature_view.get_feature_vector(
141+
entry={"id": 1}, transform=False
142+
)
143+
144+
# Fetching untransformed feature vectors.
145+
untransformed_feature_vectors = feature_view.get_feature_vectors(
146+
entry=[{"id": 1}, {"id": 2}], transform=False
147+
)
148+
149+
# Fetching untransformed batch data.
150+
untransformed_batch_data = feature_view.get_batch_data(
151+
transform=False
152+
)
153+
```
154+

0 commit comments

Comments
 (0)