Description
Since v0.11, when a dataset file column's numeric value has quotes, ML.NET mlContext.Transforms.Conversion.ConvertType()
cannot handle it properly. For instance, a column with the following values:
"1"
"0"
ML.NET ConvertType()
in a pipeline was not able to convert those values to Boolean (it was transforming all values, either "0"
and "1"
to 0
) neither to Float (all values transformed to NaN
)…
The following transformer puts a 0
to all values when converted to Boolean:
mlContext.Transforms.Conversion.ConvertType(outputColumnName: "LabelBool", inputColumnName: "Label", outputKind: DataKind.Boolean
The following transformer puts a NaN
to all values when converted to Float:
mlContext.Transforms.Conversion.ConvertType(outputColumnName: "LabelFloat", inputColumnName: "Label", outputKind: DataKind.Single
Interestingly, until ML.NET v0.10, ML.NET was able to directly load that properly into a Boolean type, properly.