dotnet / dotnet/machinelearning
Field with type string cannot be transformed for one hot encoder
- Dominant language
- C#
- Stars
- 9.4k
- Forks
- 2k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 11
Description
**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.

**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](https://github.com/dotnet/machinelearning/files/13451636/data_preparation_pipeline.zip)
[model.zip](https://github.com/dotnet/machinelearning/files/13451637/model.zip)
[input.csv](https://github.com/dotnet/machinelearning/files/13451641/input.csv)
Contributor guide
Assessment
This issue has not been assessed yet.