Skip to content

lightgbm

Light Gradient Boosting Machine

v4.6.0 · Feb 13, 2025 · MIT + file LICENSE

Description

Tree based algorithms can be improved by introducing boosting frameworks. 'LightGBM' is one such framework, based on Ke, Guolin et al. (2017) <https://papers.nips.cc/paper/6907-lightgbm-a-highly-efficient-gradient-boosting-decision>. This package offers an R interface to work with it. It is designed to be distributed and efficient with the following advantages: 1. Faster training speed and higher efficiency. 2. Lower memory usage. 3. Better accuracy. 4. Parallel learning supported. 5. Capable of handling large-scale data. In recognition of these advantages, 'LightGBM' has been widely-used in many winning solutions of machine learning competitions. Comparison experiments on public datasets suggest that 'LightGBM' can outperform existing boosting frameworks on both efficiency and accuracy, with significantly lower memory consumption. In addition, parallel experiments suggest that in certain circumstances, 'LightGBM' can achieve a linear speed-up in training time by using multiple machines.

Downloads

CRAN

6.5K

Last 30 days

1430th

20.1K

Last 90 days

101.3K

Last year

Trend: -8.8% (30d vs prior 30d)

r2u CRAN

309

Last 30 days

1.2K

Last 90 days

4.6K

Last year

Trend: -20.6% (30d vs prior 30d)

autoCRAN

12

Last 7 days

20

Last 30 days

1

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

conda-forge CRAN

462

Last 30 days

1.7K

Last 90 days

11.6K

Last year

Trend: -45.3% (30d vs prior 30d)

CRAN Check Status

3 WARNING
10 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 WARNING
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 WARNING
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 WARNING
Check details (3 non-OK)
WARNING r-devel-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: src/Makevars.win: Unknown C++ standard '@CXX_STD@' was ignored
See 'd:/Rcompile/CRANpkg/local/4.7/lightgbm.Rcheck/00install.out' for details.
* used C++ compiler: 'g++.exe (GCC) 14.3.0'
WARNING r-oldrel-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: src/Makevars.win: Unknown C++ standard '@CXX_STD@' was ignored
See 'd:/Rcompile/CRANpkg/local/4.5/lightgbm.Rcheck/00install.out' for details.
* used C++ compiler: 'g++.exe (GCC) 14.3.0'
WARNING r-release-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: src/Makevars.win: Unknown C++ standard '@CXX_STD@' was ignored
See 'd:/Rcompile/CRANpkg/local/4.6/lightgbm.Rcheck/00install.out' for details.
* used C++ compiler: 'g++.exe (GCC) 14.3.0'

Check History

WARNING 9 OK · 3 NOTE · 2 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
WARNING r-devel-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: src/Makevars.win: Unknown C++ standard '@CXX_STD@' was ignored
See 'd:/Rcompile/CRANpkg/local/4.6/lightgbm.Rcheck/00install.out' for details.
* used C++ compiler: 'g++.exe (GCC) 14.3.0'
WARNING r-release-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: src/Makevars.win: Unknown C++ standard '@CXX_STD@' was ignored
See 'd:/Rcompile/CRANpkg/local/4.5/lightgbm.Rcheck/00install.out' for details.
* used C++ compiler: 'g++.exe (GCC) 14.3.0'
NOTE r-oldrel-macos-arm64

installed package size

installed size is 68.8Mb
  sub-directories of 1Mb or more:
    libs  68.2Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 71.7Mb
  sub-directories of 1Mb or more:
    libs  71.1Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is  6.4Mb
  sub-directories of 1Mb or more:
    libs   5.8Mb

Code intelligence has not been computed for this package yet.

Code

Structure

Lines of code

213,485

Files

540

Compiled share

91.7%

Has compiled src

Yes

Language breakdown

R 6,753 (3.2%)C/C++/src 195,812 (91.7%)Tests 8,464 (4%)Docs 2,329 (1.1%)Vignettes 127 (0.1%)

API

Exported functions

28

Internal functions

46

Recent export changes

v4.4.0+1 lgb.slice.Dataset  −1 slice
v4.3.0−2 readRDS.lgb.Booster, saveRDS.lgb.Booster

Testing & CI

Has tests

Yes

Test-to-code ratio

1.25

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

96.4%

\dontrun example ratio

100%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

No

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

50%

Unsafe pattern score

0

Dep constraint coverage

50%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.5

System requirements

1

C++ standard

License

MIT + file LICENSE

License flags

SPDX valid, OSI approved

History

Versions

17

First release

2020-09-21

Latest release

2025-02-13

Avg cadence

58 days

Cold removal rate

100%

Dep drift

1

LOC over versions

v3.0.0: 48,506 LOCv3.0.0.2: 48,670 LOCv3.1.0: 51,973 LOCv3.1.1: 51,720 LOCv3.2.0: 182,437 LOCv3.2.1: 182,443 LOCv3.3.0: 183,916 LOCv3.3.1: 183,946 LOCv3.3.2: 183,950 LOCv3.3.3: 183,961 LOCv3.3.4: 184,129 LOCv3.3.5: 183,961 LOCv4.2.0: 211,585 LOCv4.3.0: 211,320 LOCv4.4.0: 212,646 LOCv4.5.0: 212,807 LOCv4.6.0: 213,485 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Reverse Dependencies (33)

Dependency Network

Dependencies Reverse dependencies R6 data.table jsonlite (>= 1.0) Matrix CGMissingDataR FoRecoML MFF cbl evoFE funcml misspi mlS3 predhy predhy.GUI qshap sae.projection ubair BORG EIX +18 more reverse deps lightgbm

Version History

18 tracked
new 4.6.0 Mar 10, 2026
updated 4.6.0 ← 4.5.0 diff Feb 12, 2025
updated 4.5.0 ← 4.4.0 diff Jul 25, 2024
updated 4.4.0 ← 4.3.0 diff Jun 14, 2024
updated 4.3.0 ← 4.2.0 diff Jan 17, 2024
updated 4.2.0 ← 3.3.5 diff Dec 7, 2023
updated 3.3.5 ← 3.3.4 diff Jan 15, 2023
updated 3.3.4 ← 3.3.3 diff Dec 15, 2022
updated 3.3.3 ← 3.3.2 diff Oct 9, 2022
updated 3.3.2 ← 3.3.1 diff Jan 13, 2022
updated 3.3.1 ← 3.3.0 diff Oct 29, 2021
updated 3.3.0 ← 3.2.1 diff Oct 8, 2021
updated 3.2.1 ← 3.2.0 diff Apr 12, 2021
updated 3.2.0 ← 3.1.1 diff Mar 21, 2021
updated 3.1.1 ← 3.1.0 diff Dec 7, 2020