Reputation: 3627
I have a machine learning problem where I have obtained very good results on training/test data using both LightGBM
and XGBoost
. The next step is to obtain predictions from one of these models into an existing C# application (.NET Framework 4.6.1) Is there any library that can help me do this? What I have tried so far:
LigthGBM
, but due to this bug it works only for .NET Core.XGBoost
model. But Windows.ML seems to work only for UWP apps, at least all samples are UWP.XGBoost
. Unfortunately, it does not support sample weights, which I rely upon.Any suggestions, or do I have to wait for ML.NET to fix the bug?
Upvotes: 2
Views: 3484
Reputation: 2456
I was able to use LightGBM in a net461
console application. The above bug only occurs if you are using packages.config
to manage your NuGet packages. In order to work around the listed bug in the LightGBM nuget package, you can take one of the following approaches:
net461
.<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net461</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ML.LightGBM" Version="0.3.0" />
</ItemGroup>
<ItemGroup>
<None Update="iris-data.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
<PackageReference>
instead of packages.config
. You can do this in the Package Manager Settings under Tools -> NuGet Package Manager menu. "Default package management format". You can refer to the Migrate from packages.config to PackageReference document for more info. <ItemGroup>
<PackageReference Include="Microsoft.ML">
<Version>0.3.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ML.LightGBM">
<Version>0.3.0</Version>
</PackageReference>
</ItemGroup>
Upvotes: 3