Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: add batch-fetch of entitites to ServingClient #1370

Open
Anntey opened this issue Mar 4, 2024 · 1 comment
Open

[Feature Request]: add batch-fetch of entitites to ServingClient #1370

Anntey opened this issue Mar 4, 2024 · 1 comment

Comments

@Anntey
Copy link

Anntey commented Mar 4, 2024

Description

  • Recommender systems utilise feature stores typically
  • Ranking models are a subset of recommender models commonly used in production
  • Ranking models create an N-to-N mapping (where as retrieval models create an 1-to-N mapping). This means that you need to fetch n_features for N entities per recommendation request.
  • Ie. first you fetch features feat_1, feat_2, feat_3 for 1 customer: result is 1 x n_cust_features. Second, you predict with model for each content entity for that single customer. This means that you fetch a set of features for all those entitites: result is n_content x n_cont_features. NOTE: this is not the same as "fetch features for all entitites" as the list of entity ids varies.

Current Behavior

result = []

for id in entity_ids:
    fpf = client.features(
        features = [
            ('content_feat_1', 'default'),
            ('content_feat_2', 'default')
        ],
        entities = {'content': id}
    )

    result.append(fpf)

Desired Behavior

fpf = client.features(
    features = [
        ('content_feat_1', 'default'),
        ('content_feat_2', 'default')
    ],
    entities = {'content': ['uid_1', 'uid_2', ..., 'uid_75']}
)

Returns

{'uid_1': [feat_1_value, feat_2_value], 'uid_2': [feat_1_value, feat_2_value], ..., 'uid_75': [feat_1_value, feat_2_value]}
or
([feat_1_value_1, feat_1_value_2, ..., feat_1_value_75], [feat_2_value_1, feat_2_value_2, ..., feat_2_value_75])

I suppose the underlying command for eg redis would look like

redis> HMGET content_feat_1 uid_1 uid_2 ... uid_75
redis> HMGET content_feat_2 uid_1 uid_2 ... uid_75

Benefits

This is MUST-HAVE feature for any organisation that uses Featureform for recommender systems.

Possible Implementation

No response

Additional Context

No response

@Anntey Anntey changed the title [Feature Request]: add fetch features for batch of entities ServingClient in client [Feature Request]: add batch-fetch features for batch of entities in ServingClient Mar 4, 2024
@Anntey Anntey changed the title [Feature Request]: add batch-fetch features for batch of entities in ServingClient [Feature Request]: add batch-fetch of features for batch of entities in ServingClient Mar 4, 2024
@Anntey Anntey changed the title [Feature Request]: add batch-fetch of features for batch of entities in ServingClient [Feature Request]: add batch-fetch of features to ServingClient Mar 4, 2024
@Anntey Anntey changed the title [Feature Request]: add batch-fetch of features to ServingClient [Feature Request]: add batch-fetch of entitites to ServingClient Mar 4, 2024
@Anntey
Copy link
Author

Anntey commented Mar 11, 2024

Isnt this batch_features() a "get all from index" basically https://github.com/featureform/featureform/blob/main/client/src/featureform/serving.py#L160. Which is different than fetching a subset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant