dotnet / dotnet/machinelearning-samples

The Iris classification sample way of reusing the "Label" column is confusing

Offen
#830 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PowerShell
Sterne
4.7k
Forks
2.7k
Ø Merge
2 T. 22 Std.
Gemergte PRs (30 T.)
1

Beschreibung

As mentioned by this ML.NET user, the way the [Iris Multiclassification sample](https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/getting-started/MulticlassClassification_Iris) reuses the "Label" column is confusing:

https://github.com/dotnet/machinelearning/issues/5264#issuecomment-652487403.

The problem is that in the sample, we have this:
```C#
.Append(mlContext.Transforms.Conversion.MapKeyToValue(outputColumnName: nameof(IrisData.Label) , inputColumnName: "KeyColumn"));

```
Which the user interpreted that it was mapping the result of the prediction to the `Label` field.

What that step is doing is to actually map the key version of `Label` back to the original value of `Label` itself. Still, I don't know why this step is necessary, since the Label column itself is never modified (the MapValueToKey used at the beginning of the pipeline is actually mapping the Label column into a new KeyColumn, so no need to map back those values).

The lack of a `MapKeyToValue` that actually mapped back the values of "PredictedLabel" was what confused the user.

Furthermore, I also find strange that later when [consuming the model](https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/getting-started/MulticlassClassification_Iris#4-consume-model) the approach to get the values for the key "PredictedLabel" column is to actually get the annotations. Which is somewhat a weird approach, since I'd find using a `MapKeyToValue` to be more user-friendly.

I guess a closer look to this is needed to determine if there's a reason behind those decisions. But at first look it seems that they're unnecessary, and it would be less confusing for users if we get rid of them. Thanks 😄

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in samples/csharp/getting-started/MulticlassClassification_Iris und überprüfe die Verwendung von MapValueToKey und MapKeyToValue in der Trainingspipeline. Lies anschließend den verlinkten Abschnitt „Consume model“, um den annotationsbasierten Zugriff mit dem vorgeschlagenen Prediction-Mapping zu vergleichen. Stelle fest, welche Schritte erforderlich sind, und aktualisiere das Beispiel so, dass die Handhabung von Label und vorhergesagtem Label klar und konsistent ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, machine-learning
Bereich
machine-learning
Issue-Typ
Refactoring
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.