You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
oneDAL Binary Classification LBFGS - Index was outside the bounds of the array. #6533
System Information (please complete the following information):
OS & Version: Windows 11
ML.NET Version: ML.NET 3.0 prerelease
.NET Version: .NET 6 & .NET 6
Describe the bug
Training a binary classification model using the Lbfgs trainer and setting the MLNET_BACKEND environment variable to ONEDAL produces the following error:
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Microsoft.ML.Trainers.LbfgsTrainerBase`3.TrainCoreOneDal(IChannel ch, RoleMappedData data)
at Microsoft.ML.Trainers.LbfgsTrainerBase`3.TrainModelCore(TrainContext context)
at Microsoft.ML.Trainers.TrainerEstimatorBase`2.TrainTransformer(IDataView trainSet, IDataView validationSet, IPredictor initPredictor)
at Microsoft.ML.Trainers.TrainerEstimatorBase`2.Fit(IDataView input)
at Microsoft.ML.Data.EstimatorChain`1.Fit(IDataView input)
at Program.<Main>$(String[] args) in C:\Dev\OneDalTest\OneDalTest\Program.cs:line 31
To Reproduce
Create a C# console application
Install the latest prerelease versions of Microsoft.ML and Microsoft.ML.OneDAL packages.
Paste the following code into the Program.cs file.
// Initialize MLContextvarctx=newMLContext();// Define datavartrainingData=new[]{new{Arch="ARM",Trainer="LightGBM",oneDALSupport=false},new{Arch="x86",Trainer="FastTree",oneDALSupport=true},new{Arch="x86",Trainer="LbfgsLogisticRegression",oneDALSupport=true},new{Arch="ARM",Trainer="FastTree",oneDALSupport=false}};// Load data into IDataViewvartrainingDv=ctx.Data.LoadFromEnumerable(trainingData);// Define data processing pipeline & trainervarpipeline=ctx.Transforms.Categorical.OneHotEncoding(new[]{newInputOutputColumnPair("ArchEncoded","Arch"),newInputOutputColumnPair("TrainerEncoded","Trainer")}).Append(ctx.Transforms.Concatenate("Features","ArchEncoded","TrainerEncoded")).Append(ctx.BinaryClassification.Trainers.LbfgsLogisticRegression(labelColumnName:"oneDALSupport"));// Train modelvarmodel=pipeline.Fit(trainingDv);
Set the MLNET_BACKEND environment variable to ONEDAL
Run the application.
Expected behavior
The model trains successfully.
Additional context
The same code using the FastTree trainer trains the model successfully.
Activity
michaelgsharp commentedon Feb 6, 2023
@rgesteve for visability.
Addresses dotnet#6533
Addresses #6533 (#6838)
Merge Main into Feature/4.0 (#6747)