Skip to content

Commit 490cb6c

Browse files
committed
review comments
1 parent 745014a commit 490cb6c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Microsoft.ML.Data/Evaluators/AnomalyDetectionEvaluator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private protected override void CheckScoreAndLabelTypes(RoleMappedSchema schema)
100100
Host.Check(schema.Label.HasValue, "Could not find the label column");
101101
t = schema.Label.Value.Type;
102102
if (t != NumberType.Float && t.GetKeyCount() != 2)
103-
throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "float or a 2-value KeyType", t.ToString());
103+
throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "float or a KeyType with cardinality 2", t.ToString());
104104
}
105105

106106
private protected override Aggregator GetAggregatorCore(RoleMappedSchema schema, string stratName)
@@ -666,7 +666,7 @@ private protected override void PrintFoldResultsCore(IChannel ch, Dictionary<str
666666

667667
IDataView overall;
668668
if (!metrics.TryGetValue(MetricKinds.OverallMetrics, out overall))
669-
throw Host.ExceptSchemaMismatch(nameof(overall.Schema), "overall metrics", MetricKinds.OverallMetrics);
669+
throw Host.Except("No overall metrics found");
670670

671671
// Find the number of anomalies, and the thresholds.
672672
int numAnomIndex;

src/Microsoft.ML.Data/Evaluators/BinaryClassifierEvaluator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private protected override void CheckScoreAndLabelTypes(RoleMappedSchema schema)
133133
host.Check(schema.Label.HasValue, "Could not find the label column");
134134
t = schema.Label.Value.Type;
135135
if (t != NumberType.R4 && t != NumberType.R8 && t != BoolType.Instance && t.GetKeyCount() != 2)
136-
throw host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "float, double, bool, or a 2-value KeyType", t.ToString());
136+
throw host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "float, double, bool, or a KeyType with cardinality 2", t.ToString());
137137
}
138138

139139
private protected override void CheckCustomColumnTypesCore(RoleMappedSchema schema)
@@ -1098,7 +1098,7 @@ private void CheckInputColumnTypes(Schema schema)
10981098

10991099
var t = schema[(int)LabelIndex].Type;
11001100
if (t != NumberType.R4 && t != NumberType.R8 && t != BoolType.Instance && t.GetKeyCount() != 2)
1101-
throw Host.ExceptSchemaMismatch(nameof(schema), "label", LabelCol, "float, double, bool or a 2-value KeyType", t.ToString());
1101+
throw Host.ExceptSchemaMismatch(nameof(schema), "label", LabelCol, "float, double, bool or a KeyType with cardinality 2", t.ToString());
11021102

11031103
t = schema[ScoreIndex].Type;
11041104
if (t != NumberType.Float)

src/Microsoft.ML.Data/Evaluators/ClusteringEvaluator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private protected override void CheckScoreAndLabelTypes(RoleMappedSchema schema)
100100
if (type != null && type != NumberType.Float && !(type is KeyType keyType && keyType.Count > 0))
101101
{
102102
throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name,
103-
"float or key", type.ToString());
103+
"float or KeyType", type.ToString());
104104
}
105105

106106
var score = schema.GetUniqueColumn(MetadataUtils.Const.ScoreValueKind.Score);

0 commit comments

Comments
 (0)