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();
}
Thank you for reporting this, and especially thank you for this wonderful snippet of code which allow to reproduce problem easily.
Most helpful comment
Thank you for reporting this, and especially thank you for this wonderful snippet of code which allow to reproduce problem easily.