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

how to return NDCG as a metric #687

Open
Lulu20220 opened this issue Aug 15, 2023 · 2 comments
Open

how to return NDCG as a metric #687

Lulu20220 opened this issue Aug 15, 2023 · 2 comments

Comments

@Lulu20220
Copy link

Hello,

I am following the tutorial here https://www.tensorflow.org/recommenders/examples/dcn to build a dcn model, but I want to have ndcg as a metric. Then I did
model.compile(optimizer='sgd', metrics=[tfr.keras.metrics.NDCGMetric()])

but still not returning ndcg.

Could someone guide me through here please?

@rlcauvin
Copy link

Which metrics is it outputting? RMSE?

@patrickorlando
Copy link

@Lulu20220 The custom model defined in the tutorial overrides the default keras train and test steps so passing a metric to compile will not work.
You need to pass the metric object to the the Ranking task defined in the DCN model here.

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

3 participants