@@ -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 . IsVector || t . ItemType != NumberType . Float )
132
- throw host . SchemaSensitive ( ) . Except ( "Score column '{0}' has type '{1}' but must be R4" , score , t ) ;
132
+ throw host . ExceptSchemaMismatch ( nameof ( schema ) , "score" , score . Name , "R4" , 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 . KeyCount != 2 )
136
- throw host . SchemaSensitive ( ) . Except ( " Label column '{0}' has type '{1}' but must be R4, R8, BL or a 2-value key", schema . Label . Value . Name , t ) ;
136
+ throw host . ExceptSchemaMismatch ( nameof ( schema ) , "label" , schema . Label . Value . Name , " R4, R8, BL or a 2-value key", t . ToString ( ) ) ;
137
137
}
138
138
139
139
private protected override void CheckCustomColumnTypesCore ( RoleMappedSchema schema )
@@ -142,14 +142,14 @@ private protected override void CheckCustomColumnTypesCore(RoleMappedSchema sche
142
142
var host = Host . SchemaSensitive ( ) ;
143
143
if ( prob != null )
144
144
{
145
- host . Check ( prob . Count == 1 , "Cannot have multiple probability columns" ) ;
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 . SchemaSensitive ( ) . Except ( "Probability column '{0}' has type '{1}' but must be R4" , prob [ 0 ] . Name , probType ) ;
148
+ throw host . ExceptSchemaMismatch ( nameof ( schema ) , "probability" , prob [ 0 ] . Name , "R4" , probType . ToString ( ) ) ;
149
149
}
150
150
else if ( ! _useRaw )
151
151
{
152
- throw host . Except (
152
+ throw host . ExceptParam ( nameof ( schema ) ,
153
153
"Cannot compute the predicted label from the probability column because it does not exist" ) ;
154
154
}
155
155
}
0 commit comments