You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace ColumnInfo usage with Schema.Column, remove ColumnInfo (#1924)
* Have RoleMappedSchema use Schema.Column not ColumnInfo.
* Have EvaluatorUtils and calling code exploit Schema.Column not ColumnInfo.
* Replace other few miscellaneous usages of ColumnInfo with Schema.Column.
* Remove ColumnInfo.
* Improve error reporting uniformity through usage of SchemaMismatch contracts helpers in several places.
Copy file name to clipboardExpand all lines: src/Microsoft.ML.Data/Depricated/Instances/HeaderSchema.cs
+6-5
Original file line number
Diff line number
Diff line change
@@ -185,13 +185,14 @@ public static FeatureNameCollection Create(RoleMappedSchema schema)
185
185
{
186
186
// REVIEW: This shim should be deleted as soon as is convenient.
187
187
Contracts.CheckValue(schema,nameof(schema));
188
-
Contracts.CheckParam(schema.Feature!=null,nameof(schema),"Cannot create feature name collection if we have no features");
189
-
Contracts.CheckParam(schema.Feature.Type.ValueCount>0,nameof(schema),"Cannot create feature name collection if our features are not of known size");
188
+
Contracts.CheckParam(schema.Feature.HasValue,nameof(schema),"Cannot create feature name collection if we have no features");
189
+
varfeatureCol=schema.Feature.Value;
190
+
Contracts.CheckParam(schema.Feature.Value.Type.ValueCount>0,nameof(schema),"Cannot create feature name collection if our features are not of known size");
throwHost.Except("Score column '{0}' has type '{1}' but must be R4",score,t).MarkSensitive(MessageSensitivity.Schema);
100
-
Host.Check(schema.Label!=null,"Could not find the label column");
101
-
t=schema.Label.Type;
100
+
Host.Check(schema.Label.HasValue,"Could not find the label column");
101
+
t=schema.Label.Value.Type;
102
102
if(t!=NumberType.Float&&t.KeyCount!=2)
103
-
throwHost.Except("Label column '{0}' has type '{1}' but must be R4 or a 2-value key",schema.Label.Name,t).MarkSensitive(MessageSensitivity.Schema);
103
+
throwHost.Except("Label column '{0}' has type '{1}' but must be R4 or a 2-value key",schema.Label.Value.Name,t).MarkSensitive(MessageSensitivity.Schema);
0 commit comments