diff --git a/src/Microsoft.Data.Analysis/GroupBy.cs b/src/Microsoft.Data.Analysis/GroupBy.cs index 5d8013e9b6..7572e01a9a 100644 --- a/src/Microsoft.Data.Analysis/GroupBy.cs +++ b/src/Microsoft.Data.Analysis/GroupBy.cs @@ -82,7 +82,7 @@ public GroupBy(DataFrame dataFrame, int groupByColumnIndex, IDictionary rows, TKey key, bool firstGroup); diff --git a/src/Microsoft.Data.Analysis/StringDataFrameColumn.cs b/src/Microsoft.Data.Analysis/StringDataFrameColumn.cs index 4faea0ee58..e249f21557 100644 --- a/src/Microsoft.Data.Analysis/StringDataFrameColumn.cs +++ b/src/Microsoft.Data.Analysis/StringDataFrameColumn.cs @@ -374,7 +374,7 @@ private StringDataFrameColumn Clone(PrimitiveDataFrameColumn mapIndices = { if (mapIndices is null) { - StringDataFrameColumn ret = new StringDataFrameColumn(Name, mapIndices is null ? Length : mapIndices.Length); + StringDataFrameColumn ret = new StringDataFrameColumn(Name, Length); for (long i = 0; i < Length; i++) { ret[i] = this[i]; diff --git a/src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs b/src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs index 4ddf832782..336d9daa56 100644 --- a/src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs +++ b/src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs @@ -277,7 +277,7 @@ private void GetPredictedLabelCore(float score, ref bool value) private void GetPredictedLabelCoreAsKey(float score, ref uint value) { - value = (uint)(score > _threshold ? 2 : score <= _threshold ? 1 : 0); + value = (uint)(score > _threshold ? 2 : 1); } private protected override JToken PredictedLabelPfa(string[] mapperOutputs) diff --git a/src/Microsoft.ML.Maml/MAML.cs b/src/Microsoft.ML.Maml/MAML.cs index bf342f9014..5d071682ad 100644 --- a/src/Microsoft.ML.Maml/MAML.cs +++ b/src/Microsoft.ML.Maml/MAML.cs @@ -82,18 +82,8 @@ private static int MainWithProgress(string args) private static ConsoleEnvironment CreateEnvironment() { - string sensitivityString = null; MessageSensitivity sensitivity = MessageSensitivity.All; - if (!string.IsNullOrWhiteSpace(sensitivityString)) - { - // Cannot use host or channels since the environment isn't even - // created yet. - if (!Enum.TryParse(sensitivityString, out sensitivity)) - { - Console.Error.WriteLine("Cannot parse '{0}' as {1}", sensitivityString, nameof(MessageSensitivity)); - sensitivity = MessageSensitivity.All; - } - } + return new ConsoleEnvironment(sensitivity: sensitivity); }