Skip to content

Commit b37b474

Browse files
committed
review comments
1 parent 1523ef2 commit b37b474

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
@@ -99,7 +99,7 @@ private protected override void CheckScoreAndLabelTypes(RoleMappedSchema schema)
9999
Host.Check(schema.Label.HasValue, "Could not find the label column");
100100
t = schema.Label.Value.Type;
101101
if (t != NumberType.Float && t.GetKeyCount() != 2)
102-
throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "float or a 2-value KeyType", t.ToString());
102+
throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "float or a KeyType with cardinality 2", t.ToString());
103103
}
104104

105105
private protected override Aggregator GetAggregatorCore(RoleMappedSchema schema, string stratName)
@@ -665,7 +665,7 @@ private protected override void PrintFoldResultsCore(IChannel ch, Dictionary<str
665665

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

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

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

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

138138
private protected override void CheckCustomColumnTypesCore(RoleMappedSchema schema)
@@ -1097,7 +1097,7 @@ private void CheckInputColumnTypes(Schema schema)
10971097

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

11021102
t = schema[ScoreIndex].Type;
11031103
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
@@ -99,7 +99,7 @@ private protected override void CheckScoreAndLabelTypes(RoleMappedSchema schema)
9999
if (type != null && type != NumberType.Float && !(type is KeyType keyType && keyType.Count > 0))
100100
{
101101
throw Host.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name,
102-
"float or key", type.ToString());
102+
"float or KeyType", type.ToString());
103103
}
104104

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

0 commit comments

Comments
 (0)