dotnet / dotnet/machinelearning-samples
MapValueToKey in ranking sample
- Dominant language
- PowerShell
- Stars
- 4.7k
- Forks
- 2.7k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 1
Description
In the ranking sample, we're using a `MapValueToKey` transform to convert the `Label` `UINT` values `{ 0, 1, 2, 3, 4 }` to a `Key`. This seems incorrect as the `MapValueToKey` will order the `Key` by the order it sees them. This will cause the ranker to randomly switch label values, a "good" could used internally as "bad".
`MapValueToKey` transform in the ranking example:
https://github.com/dotnet/machinelearning-samples/blob/8697bec3e9c78beb2c3c4d3f915551c85bcdcb39/samples/csharp/getting-started/Ranking_Web/WebRanking/Program.cs#L150
Work:
1. We should validate that the current sample is working as expected. It may be permuting the labels.
2. Ideally we would expose the ability to directly set the term list for `MapValueToKey`; I don't see this [term list parameter](https://github.com/dotnet/machinelearning/blob/59dbdeac6f01941e0b1b1dc1f026f599a7b676c9/src/Microsoft.ML.Data/Transforms/ValueToKeyMappingTransformer.cs#L51-L52) exposed in the estimators API.
Contributor guide
Assessment
This issue has not been assessed yet.