You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add example in docs for entity aliasing
Signed-off-by: Cody Lin <codyl@twitter.com>
* Improve the paragraph organization and make it clearer
Signed-off-by: Cody Lin <codyl@twitter.com>
Copy file name to clipboardExpand all lines: docs/getting-started/concepts/feature-view.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,54 @@ global_stats_fv = FeatureView(
53
53
{% endtab %}
54
54
{% endtabs %}
55
55
56
+
## Entity aliasing
57
+
58
+
"Entity aliases" can be specified to join `entity_dataframe` columns that do not match the column names in the source table of a FeatureView.
59
+
60
+
This could be used if a user has no control over these column names or if there are multiple entities are a subclass of a more general entity. For example, "spammer" and "reporter" could be aliases of a "user" entity, and "origin" and "destination" could be aliases of a "location" entity as shown below.
61
+
62
+
It is suggested that you dynamically specify the new FeatureView name using `.with_name` and `join_key_map` override using `.with_join_key_map` instead of needing to register each new copy.
from location_stats_feature_view import location_stats_fv
84
+
85
+
temperatures_fs = FeatureService(
86
+
name="temperatures",
87
+
features=[
88
+
location_stats_feature_view
89
+
.with_name("origin_stats")
90
+
.with_join_key_map(
91
+
{"location_id": "origin_id"}
92
+
),
93
+
location_stats_feature_view
94
+
.with_name("destination_stats")
95
+
.with_join_key_map(
96
+
{"location_id": "destination_id"}
97
+
),
98
+
],
99
+
)
100
+
```
101
+
{% endtab %}
102
+
{% endtabs %}
103
+
56
104
## Feature
57
105
58
106
A feature is an individual measurable property. It is typically a property observed on a specific entity, but does not have to be associated with an entity. For example, a feature of a `customer` entity could be the number of transactions they have made on an average month, while a feature that is not observed on a specific entity could be the total number of posts made by all users in the last month.
0 commit comments