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();
}
The following will throw a very ugly exception only when calling
Preview()and not before: