FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: Fix ODFV decorator by felixwang9817 · Pull Request #2527 · feast-dev/feast · GitHub

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .md  (3) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
Fix ODFV decorators in docs
Signed-off-by: Felix Wang <wangfelix98@gmail.com>
  • Loading branch information
felixwang9817 committed Apr 12, 2022
commit f1a057ef09c663209da794fc8c6b6647cd6fcf97
10 changes: 6 additions & 4 deletions docs/getting-started/concepts/feature-view.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ Feature names must be unique within a [feature view](feature-view.md#feature-vie
On demand feature views allows users to use existing features and request time data (features only available at request time) to transform and create new features. Users define python transformation logic which is executed in both historical retrieval and online retrieval paths:

```python
from feast import Field, Float64, RequestSource

# Define a request data source which encodes features / information only
# available at request time (e.g. part of the user initiated HTTP request)
input_request = RequestSource(
Expand All @@ -150,13 +152,13 @@ input_request = RequestSource(

# Use the input data and feature view features to create new features
@on_demand_feature_view(
inputs={
sources={
'driver_hourly_stats': driver_hourly_stats_view,
'vals_to_add': input_request
},
features=[
Feature(name='conv_rate_plus_val1', dtype=ValueType.DOUBLE),
Feature(name='conv_rate_plus_val2', dtype=ValueType.DOUBLE)
schema=[
Field(name='conv_rate_plus_val1', dtype=Float64),
Field(name='conv_rate_plus_val2', dtype=Float64)
]
)
def transformed_conv_rate(features_df: pd.DataFrame) -> pd.DataFrame:
Expand Down
10 changes: 6 additions & 4 deletions docs/reference/alpha-on-demand-feature-view.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ See [https://github.com/feast-dev/on-demand-feature-views-demo](https://github.c
We register `RequestDataSource` inputs and the transform in `on_demand_feature_view`:

```python
from feast import Field, Float64, RequestSource

# Define a request data source which encodes features / information only
# available at request time (e.g. part of the user initiated HTTP request)
input_request = RequestDataSource(
Expand All @@ -40,13 +42,13 @@ input_request = RequestDataSource(

# Use the input data and feature view features to create new features
@on_demand_feature_view(
inputs={
sources={
'driver_hourly_stats': driver_hourly_stats_view,
'vals_to_add': input_request
},
features=[
Feature(name='conv_rate_plus_val1', dtype=ValueType.DOUBLE),
Feature(name='conv_rate_plus_val2', dtype=ValueType.DOUBLE)
schema=[
Field(name='conv_rate_plus_val1', dtype=Float64),
Field(name='conv_rate_plus_val2', dtype=Float64)
]
)
def transformed_conv_rate(features_df: pd.DataFrame) -> pd.DataFrame:
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorials/validating-historical-features.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pyarrow.parquet.write_table(entities_2019_table, "entities.parquet")
import pyarrow.parquet
import pandas as pd

from feast import Feature, FeatureView, Entity, FeatureStore, Field, Float64, Int64
from feast import FeatureView, Entity, FeatureStore, Field, Float64, Int64
from feast.value_type import ValueType
from feast.data_format import ParquetFormat
from feast.on_demand_feature_view import on_demand_feature_view
Expand Down Expand Up @@ -153,11 +153,11 @@ trips_stats_fv = FeatureView(

```python
@on_demand_feature_view(
features=[
Feature("avg_fare", ValueType.DOUBLE),
Feature("avg_speed", ValueType.DOUBLE),
Feature("avg_trip_seconds", ValueType.DOUBLE),
Feature("earned_per_hour", ValueType.DOUBLE),
schema=[
Field("avg_fare", Float64),
Field("avg_speed", Float64),
Field("avg_trip_seconds", Float64),
Field("earned_per_hour", Float64),
],
inputs={
"stats": trips_stats_fv
Expand Down

Back | FazBrowse Home | New Git URL