Skip to content

Field with type string cannot be transformed for one hot encoder #6889

@VadimPeczynski

Description

@VadimPeczynski

System Information (please complete the following information):

  • OS & Version: Windows 10
  • ML.NET Version: ML.NET v3.0.0-preview.23511.1
  • .NET Version: .NET 7.0

Describe the bug
I'm not able to process the data which I'm providing, when I'm using in the model one hot encoder. The string can not be processed.
image

To Reproduce
Steps to reproduce the behavior:

//Define DataViewSchema for data preparation pipeline and trained model
DataViewSchema dataPrepPipelineSchema, modelSchema;

// Load trained model
ITransformer dataPrepPipeline = mlContext.Model.Load("data_preparation_pipeline.zip", out dataPrepPipelineSchema);
ITransformer predictionPipeline = mlContext.Model.Load("model.zip", out modelSchema);

//Load New Data
var newData = DataFrame.LoadCsv("data/input.csv");

// Preprocess Data
IDataView transformedNewData = dataPrepPipeline.Transform(newData);

IDataView predictions = predictionPipeline.Transform(transformedNewData);

Expected behavior
Model can load data with type string
data_preparation_pipeline.zip
model.zip
input.csv

Metadata

Metadata

Assignees

No one assigned

    Labels

    untriagedNew issue has not been triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions