LightGBM.Net

November 27, 2025 ยท View on GitHub

.Net wrapper for LightGBM

PackageNuGet
LightGBMNet.TrainNuGet version
LightGBMNet.TreeNuGet version
  • Native LightGBM binaries in NuGet package are compiled for Intel/AMD 64 bit processors with Visual Studio 2022 (requires corresponding Visual C++ 2022 redistributable package to be installed).
  • Training generates both a simple wrapper around the native LightGBM ensemble, and a corresponding 100% managed tree ensemble implementation.
  • Managed implementation is fully self-contained in LightGBMNet.Tree (a .NET Standard 2.0 assembly), with rigorous unit testing to ensure native and managed models generate identical outputs.
  • See training unit tests for usage examples.
  • GPU support:
    • Compile native LightGBM DLL/EXE/SO files for your GPU configuration as per the instructions here.
    • Copy the native LightGBM files with GPU support over the CPU only versions in the native directory (or over those found in the runtimes\(RID)\native directory of the NuGet package)
    • Set DeviceType parameter to GPU.