Skip to content

Unintuitive error when giving array to OneHotEncoder #2678

Description

@rauhs

The following will throw a very ugly exception only when calling Preview() and not before:

    public class MlDataEx
    {
      public string[] A { get; set; }
      public MlDataEx(string a)
      {
        this.A = new[] { a };
      }
    }

    public static void MlStuff()
    {
      var ctx = new MLContext();
      var dv = ctx.Data.ReadFromEnumerable(new[] { new MlDataEx("A") });
      var data = ctx.Transforms.Categorical.OneHotEncoding("A").Fit(dv).Transform(dv).Preview();
    }

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions