Repository navigation
Closed
Labels
documentationRelated to documentation of ML.NETRelated to documentation of ML.NETenhancementNew feature or requestNew feature or request
Description
public class Digit
{
[Column("0")] public float Up;
[Column("1")] public float Middle;
[Column("2")] public float Bottom;
[Column("3")] public float UpLeft;
[Column("4")] public float BottomLeft;
[Column("5")] public float TopRight;
[Column("6")] public float BottomRight;
[Column("7")] [ColumnName("Label")] public float Label;
}
public class DigitPrediction
{
[ColumnName("PredictedLabel")]
public uint ExpectedDigit;
[ColumnName("Score")]
public float[] Score;
}
var pipeline = new LearningPipeline();
var data = new Digit[]
{
new Digit { Up = 1, Middle = 0, Bottom = 1, UpLeft = 1, BottomLeft = 1, TopRight = 1, BottomRight = 1, Label = 0 },
new Digit { Up = 0, Middle = 0, Bottom = 0, UpLeft = 0, BottomLeft = 0, TopRight = 1, BottomRight = 1, Label = 1 },
new Digit { Up = 1, Middle = 1, Bottom = 1, UpLeft = 0, BottomLeft = 1, TopRight = 1, BottomRight = 0, Label = 2 },
new Digit { Up = 1, Middle = 1, Bottom = 1, UpLeft = 0, BottomLeft = 0, TopRight = 1, BottomRight = 1, Label = 3 },
new Digit { Up = 0, Middle = 1, Bottom = 0, UpLeft = 1, BottomLeft = 1, TopRight = 1, BottomRight = 1, Label = 4 },
new Digit { Up = 1, Middle = 1, Bottom = 1, UpLeft = 1, BottomLeft = 1, TopRight = 0, BottomRight = 1, Label = 5 },
new Digit { Up = 1, Middle = 1, Bottom = 1, UpLeft = 1, BottomLeft = 1, TopRight = 0, BottomRight = 1, Label = 6 },
new Digit { Up = 1, Middle = 0, Bottom = 0, UpLeft = 0, BottomLeft = 0, TopRight = 1, BottomRight = 1, Label = 7 },
new Digit { Up = 1, Middle = 1, Bottom = 1, UpLeft = 1, BottomLeft = 1, TopRight = 1, BottomRight = 1, Label = 8 },
new Digit { Up = 1, Middle = 1, Bottom = 1, UpLeft = 1, BottomLeft = 0, TopRight = 1, BottomRight = 1, Label = 9 }
};
pipeline.Add(CollectionDataSource.Create(data));
pipeline.Add(new ColumnConcatenator("Features", "Up", "Middle", "Bottom", "UpLeft", "BottomLeft", "TopRight", "BottomRight"));
pipeline.Add(new StochasticDualCoordinateAscentClassifier());
var model = pipeline.Train<Digit, DigitPrediction>();
var prediction = model.Predict(new Digit
{
Up = 1,
Middle = 1,
Bottom = 1,
UpLeft = 1,
BottomLeft = 1,
TopRight = 1,
BottomRight = 1});
I have this wonderful test, but for ExpectedDigit is shifted by 1. I.e if it predict digit 9, it put 10 into expectedDigit
Metadata
Metadata
Assignees
Labels
documentationRelated to documentation of ML.NETRelated to documentation of ML.NETenhancementNew feature or requestNew feature or request
Activity
Ivanidzo4ka commentedon May 24, 2018
slightly related to #226.
@yaeldekel @TomFinley any chance you know why it's +1?
machinelearning/src/Microsoft.ML.Data/Scorers/MultiClassClassifierScorer.cs
Line 569 in 2bbef17
Ivanidzo4ka commentedon May 24, 2018
same for clustering
machinelearning/src/Microsoft.ML.Data/Scorers/ClusteringScorer.cs
Line 114 in 35b8134
TomFinley commentedon May 24, 2018
Hi @Ivanidzo4ka ... The output is a key value, and it is important for various reasons that the default value of a key value be undefined, rather than any particular class. So if the "default" clustering were the first class.
We probably ought to have a better story for this. Right now the API does not expose this sort of enumeration "well." A language like R has pretty deep support for this concept in the form of factors. I'm not sure how the API should expose this concept, but it's a fairly central one, so we ought to have a better story than just a
uintbeing surfaced somewhere. (We have docs describing key values, but I wrote that more as code rather than user documentation.)Zruty0 commentedon Dec 18, 2018
This seems to be a documentation issue: we should document how we handle key types.
And, by the way, this handling has actually changed along the way: as far as I remember, the key values are no longer off by 1, if you use schema comprehension to read the data via
AsEnumerable<T>.Fix test file locations on OSX (dotnet#235)
code migration from machinelearning-automl to machinelearning repo fe…
shmoradims commentedon Jun 7, 2019
This is an old issue and seems to have been fixed in 1.0, as seen in this example.
Fix test file locations on OSX (dotnet#235)
Added onnx export functionality for LpNormNormalizingTransformer (#4161)
Added Onnx export functionality to PCATransformer (#4188)