Skip to content

In v0.11 Transforms.Conversion.ConvertType() does not properly convert numeric values if they are "in quotes"  #2824

Closed
@CESARDELATORRE

Description

@CESARDELATORRE

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.

Metadata

Metadata

Assignees

Labels

P1Priority of the issue for triage purpose: Needs to be fixed soon.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions