dotnet / dotnet/machinelearning-samples

Update Ranking Sample for NDCG Truncation Level

Aperta
#607 0 commenti 0 reazioni 1 assegnatario Rivendicata da @nicolehaugen Vedi su GitHub
Lingua principale
PowerShell
Stelle
4.7k
Fork
2.7k
Merge medio
2g 22h
PR unite (30g)
1

Descrizione

There's a PR out to allow the user to set the truncation level for the DCG/NDCG metics:
https://github.com/dotnet/machinelearning/pull/4081/

In our sample, we currently are using reflection to set this truncation level:
https://github.com/dotnet/machinelearning-samples/blob/f50535f048df3b6e7b41c2093b5c9027030b5359/samples/csharp/getting-started/Ranking_Web/WebRanking/Common/ConsoleHelper.cs#L32-L40

Task: We should use the public method to set the DCG/NDCG truncation level once available (after the PR).

We may also want to show off how to get the NDCG metric at multiple thresholds, similar to the TensorFlow ranking example: ([link](https://github.com/tensorflow/ranking/blob/46dfc825b3782a4b928431a499e5ff09078dca63/tensorflow_ranking/examples/tf_ranking_libsvm.ipynb))
```python
metric_fns.update({
"metric/ndcg@%d" % topn: tfr.metrics.make_ranking_metric_fn(
tfr.metrics.RankingMetricKey.NDCG, topn=topn)
for topn in [1, 3, 5, 10]
})
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.