@@ -129,11 +129,11 @@ private protected override void CheckScoreAndLabelTypes(RoleMappedSchema schema)
129
129
var host = Host . SchemaSensitive ( ) ;
130
130
var t = score . Type ;
131
131
if ( t != NumberType . Float )
132
- throw host . ExceptSchemaMismatch ( nameof ( schema ) , "score" , score . Name , "R4 " , t . ToString ( ) ) ;
132
+ throw host . ExceptSchemaMismatch ( nameof ( schema ) , "score" , score . Name , "float " , t . ToString ( ) ) ;
133
133
host . Check ( schema . Label . HasValue , "Could not find the label column" ) ;
134
134
t = schema . Label . Value . Type ;
135
135
if ( t != NumberType . R4 && t != NumberType . R8 && t != BoolType . Instance && t . GetKeyCount ( ) != 2 )
136
- throw host . ExceptSchemaMismatch ( nameof ( schema ) , "label" , schema . Label . Value . Name , "R4, R8, BL or a 2-value key " , t . ToString ( ) ) ;
136
+ throw host . ExceptSchemaMismatch ( nameof ( schema ) , "label" , schema . Label . Value . Name , "float, double, bool, or a KeyType with cardinality 2 " , t . ToString ( ) ) ;
137
137
}
138
138
139
139
private protected override void CheckCustomColumnTypesCore ( RoleMappedSchema schema )
@@ -145,7 +145,7 @@ private protected override void CheckCustomColumnTypesCore(RoleMappedSchema sche
145
145
host . CheckParam ( prob . Count == 1 , nameof ( schema ) , "Cannot have multiple probability columns" ) ;
146
146
var probType = prob [ 0 ] . Type ;
147
147
if ( probType != NumberType . Float )
148
- throw host . ExceptSchemaMismatch ( nameof ( schema ) , "probability" , prob [ 0 ] . Name , "R4 " , probType . ToString ( ) ) ;
148
+ throw host . ExceptSchemaMismatch ( nameof ( schema ) , "probability" , prob [ 0 ] . Name , "float " , probType . ToString ( ) ) ;
149
149
}
150
150
else if ( ! _useRaw )
151
151
{
@@ -1098,18 +1098,18 @@ private void CheckInputColumnTypes(Schema schema)
1098
1098
1099
1099
var t = schema [ ( int ) LabelIndex ] . Type ;
1100
1100
if ( t != NumberType . R4 && t != NumberType . R8 && t != BoolType . Instance && t . GetKeyCount ( ) != 2 )
1101
- throw Host . Except ( "Label column '{0}' has type '{1}' but must be R4, R8, BL or a 2-value key ", LabelCol , t ) ;
1101
+ throw Host . ExceptSchemaMismatch ( nameof ( schema ) , "label" , LabelCol , "float, double, bool or a KeyType with cardinality 2 ", t . ToString ( ) ) ;
1102
1102
1103
1103
t = schema [ ScoreIndex ] . Type ;
1104
1104
if ( t != NumberType . Float )
1105
- throw Host . Except ( "Score column '{0}' has type '{1}' but must be R4" , ScoreCol , t ) ;
1105
+ throw Host . ExceptSchemaMismatch ( nameof ( schema ) , "score" , ScoreCol , "float" , t . ToString ( ) ) ;
1106
1106
1107
1107
if ( _probIndex >= 0 )
1108
1108
{
1109
1109
Host . Assert ( ! string . IsNullOrEmpty ( _probCol ) ) ;
1110
1110
t = schema [ _probIndex ] . Type ;
1111
1111
if ( t != NumberType . Float )
1112
- throw Host . Except ( "Probability column '{0}' has type '{1}' but must be R4" , _probCol , t ) ;
1112
+ throw Host . ExceptSchemaMismatch ( nameof ( schema ) , "probability" , _probCol , "float" , t . ToString ( ) ) ;
1113
1113
}
1114
1114
else if ( ! _useRaw )
1115
1115
throw Host . Except ( "Cannot compute the predicted label from the probability column because it does not exist" ) ;
0 commit comments