Skip to content

Commit

Permalink
primary_keys -> primary_key (#394)
Browse files Browse the repository at this point in the history
Co-authored-by: davitbzh <[email protected]>
  • Loading branch information
davitbzh and davitbzh authored Jul 10, 2024
1 parent 463aa13 commit 2689d3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/user_guides/fs/feature_view/batch-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ It is very common that ML models are deployed in a "batch" setting where ML pipe
## Retrieve batch data with primary keys and event time
For certain use cases, e.g. time series models, the input data needs to be sorted according to the primary key(s) and event time combination. Or one might want to merge predictions back with the original input data for postmortem analysis.
Primary key(s) and event time are not usually included in the feature view query as they are not features used for training.
To retrieve the primary key(s) and/or event time when retrieving batch data for inference, you need to set the parameters `primary_keys=True` and/or `event_time=True`.
To retrieve the primary key(s) and/or event time when retrieving batch data for inference, you need to set the parameters `primary_key=True` and/or `event_time=True`.

=== "Python"
```python
# get batch data
df = feature_view.get_batch_data(
start_time = "20220620",
end_time = "20220627",
primary_keys=True,
primary_key=True,
event_time=True
) # return a dataframe with primary keys and event time
```
Expand Down
6 changes: 3 additions & 3 deletions docs/user_guides/fs/feature_view/training-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,21 @@ X_train, X_val, X_test, y_train, y_val, y_test = feature_view.get_train_validati
## Read training data with primary key(s) and event time
For certain use cases, e.g. time series models, the input data needs to be sorted according to the primary key(s) and event time combination.
Primary key(s) and event time are not usually included in the feature view query as they are not features used for training.
To retrieve the primary key(s) and/or event time when retrieving training data, you need to set the parameters `primary_keys=True` and/or `event_time=True`.
To retrieve the primary key(s) and/or event time when retrieving training data, you need to set the parameters `primary_key=True` and/or `event_time=True`.


```python
# get a training dataset
X_train, X_test, y_train, y_test = feature_view.get_train_test_split(training_dataset_version=1,
primary_keys=True,
primary_key=True,
event_time=True)
```

!!! note
All primary and event time columns of all the feature groups included in the feature view will be returned. If they have the same names across feature groups and the join prefix was not provided then reading operation will fail with ambiguous column exception.
Make sure to define the join prefix if primary key and event time columns have the same names across feature groups.

To use primary key(s) and event time column with materialized training datasets it needs to be created with `primary_keys=True` and/or `with_event_time=True`.
To use primary key(s) and event time column with materialized training datasets it needs to be created with `primary_key=True` and/or `with_event_time=True`.

## Deletion
To clean up unused training data, you can delete all training data or for a particular version. Note that all metadata of training data and materialised files stored in HopsFS will be deleted and cannot be recreated anymore.
Expand Down

0 comments on commit 2689d3f

Please sign in to comment.