Full Code of lightgbm-org/LightGBM for AI

master 8e7f3dcf4207 cached
509 files
16.7 MB
4.0M tokens
1754 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (15,857K chars total). Download the full file to get everything.
Repository: lightgbm-org/LightGBM
Branch: master
Commit: 8e7f3dcf4207
Files: 509
Total size: 16.7 MB

Directory structure:
gitextract_uh184o35/

├── .appveyor.yml
├── .ci/
│   ├── README.md
│   ├── append-comment.sh
│   ├── build-docs.sh
│   ├── check-dynamic-dependencies.sh
│   ├── check-omp-pragmas.sh
│   ├── check-python-dists.sh
│   ├── check-workflow-status.sh
│   ├── conda-envs/
│   │   ├── README.md
│   │   ├── ci-core-py39.txt
│   │   └── ci-core.txt
│   ├── create-nuget.py
│   ├── download-artifacts.sh
│   ├── install-opencl.ps1
│   ├── install-r-deps.R
│   ├── lint-all.sh
│   ├── lint-powershell.ps1
│   ├── lint-r-code.R
│   ├── parameter-generator.py
│   ├── pip-envs/
│   │   ├── requirements-latest.txt
│   │   └── requirements-oldest.txt
│   ├── rerun-workflow.sh
│   ├── run-r-cmd-check.sh
│   ├── set-commit-status.sh
│   ├── setup.sh
│   ├── test-python-latest.sh
│   ├── test-python-oldest.sh
│   ├── test-r-package-valgrind.sh
│   ├── test-r-package-windows.ps1
│   ├── test-r-package.sh
│   ├── test-windows.ps1
│   └── test.sh
├── .editorconfig
├── .git-blame-ignore-revs
├── .github/
│   ├── CODEOWNERS
│   ├── ISSUE_TEMPLATE/
│   │   ├── BUG_REPORT.md
│   │   └── FEATURE_REQUEST.md
│   ├── dependabot.yml
│   ├── release-drafter.yml
│   └── workflows/
│       ├── build.yml
│       ├── cpp.yml
│       ├── cuda.yml
│       ├── lock.yml
│       ├── lychee.yml
│       ├── no_response.yml
│       ├── optional_checks.yml
│       ├── python_package.yml
│       ├── r_configure.yml
│       ├── r_package.yml
│       ├── r_valgrind.yml
│       ├── release_drafter.yml
│       ├── static_analysis.yml
│       └── swig.yml
├── .gitignore
├── .gitmodules
├── .pre-commit-config.yaml
├── .readthedocs.yaml
├── .typos.toml
├── .yamllint.yml
├── CMakeLists.txt
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── MAINTAINING.md
├── R-package/
│   ├── .Rbuildignore
│   ├── AUTOCONF_UBUNTU_VERSION
│   ├── DESCRIPTION
│   ├── LICENSE
│   ├── NAMESPACE
│   ├── R/
│   │   ├── aliases.R
│   │   ├── callback.R
│   │   ├── lgb.Booster.R
│   │   ├── lgb.DataProcessor.R
│   │   ├── lgb.Dataset.R
│   │   ├── lgb.Predictor.R
│   │   ├── lgb.convert_with_rules.R
│   │   ├── lgb.cv.R
│   │   ├── lgb.drop_serialized.R
│   │   ├── lgb.importance.R
│   │   ├── lgb.interprete.R
│   │   ├── lgb.make_serializable.R
│   │   ├── lgb.model.dt.tree.R
│   │   ├── lgb.plot.importance.R
│   │   ├── lgb.plot.interpretation.R
│   │   ├── lgb.restore_handle.R
│   │   ├── lgb.train.R
│   │   ├── lightgbm.R
│   │   ├── metrics.R
│   │   ├── multithreading.R
│   │   └── utils.R
│   ├── README.md
│   ├── cleanup
│   ├── configure
│   ├── configure.ac
│   ├── configure.win
│   ├── cran-comments.md
│   ├── demo/
│   │   ├── 00Index
│   │   ├── basic_walkthrough.R
│   │   ├── boost_from_prediction.R
│   │   ├── categorical_features_rules.R
│   │   ├── cross_validation.R
│   │   ├── early_stopping.R
│   │   ├── efficient_many_training.R
│   │   ├── leaf_stability.R
│   │   ├── multiclass.R
│   │   ├── multiclass_custom_objective.R
│   │   └── weight_param.R
│   ├── inst/
│   │   ├── Makevars
│   │   └── make-r-def.R
│   ├── man/
│   │   ├── agaricus.test.Rd
│   │   ├── agaricus.train.Rd
│   │   ├── bank.Rd
│   │   ├── dim.Rd
│   │   ├── dimnames.lgb.Dataset.Rd
│   │   ├── getLGBMThreads.Rd
│   │   ├── get_field.Rd
│   │   ├── lgb.Dataset.Rd
│   │   ├── lgb.Dataset.construct.Rd
│   │   ├── lgb.Dataset.create.valid.Rd
│   │   ├── lgb.Dataset.save.Rd
│   │   ├── lgb.Dataset.set.categorical.Rd
│   │   ├── lgb.Dataset.set.reference.Rd
│   │   ├── lgb.configure_fast_predict.Rd
│   │   ├── lgb.convert_with_rules.Rd
│   │   ├── lgb.cv.Rd
│   │   ├── lgb.drop_serialized.Rd
│   │   ├── lgb.dump.Rd
│   │   ├── lgb.get.eval.result.Rd
│   │   ├── lgb.importance.Rd
│   │   ├── lgb.interprete.Rd
│   │   ├── lgb.load.Rd
│   │   ├── lgb.make_serializable.Rd
│   │   ├── lgb.model.dt.tree.Rd
│   │   ├── lgb.plot.importance.Rd
│   │   ├── lgb.plot.interpretation.Rd
│   │   ├── lgb.restore_handle.Rd
│   │   ├── lgb.save.Rd
│   │   ├── lgb.slice.Dataset.Rd
│   │   ├── lgb.train.Rd
│   │   ├── lgb_predict_shared_params.Rd
│   │   ├── lgb_shared_dataset_params.Rd
│   │   ├── lgb_shared_params.Rd
│   │   ├── lightgbm.Rd
│   │   ├── predict.lgb.Booster.Rd
│   │   ├── print.lgb.Booster.Rd
│   │   ├── setLGBMThreads.Rd
│   │   ├── set_field.Rd
│   │   └── summary.lgb.Booster.Rd
│   ├── pkgdown/
│   │   └── _pkgdown.yml
│   ├── recreate-configure.sh
│   ├── src/
│   │   ├── Makevars.in
│   │   ├── Makevars.win.in
│   │   ├── install.libs.R
│   │   ├── lightgbm_R.cpp
│   │   └── lightgbm_R.h
│   ├── tests/
│   │   ├── testthat/
│   │   │   ├── helper.R
│   │   │   ├── test_Predictor.R
│   │   │   ├── test_basic.R
│   │   │   ├── test_custom_objective.R
│   │   │   ├── test_dataset.R
│   │   │   ├── test_learning_to_rank.R
│   │   │   ├── test_lgb.Booster.R
│   │   │   ├── test_lgb.convert_with_rules.R
│   │   │   ├── test_lgb.importance.R
│   │   │   ├── test_lgb.interprete.R
│   │   │   ├── test_lgb.model.dt.tree.R
│   │   │   ├── test_lgb.plot.importance.R
│   │   │   ├── test_lgb.plot.interpretation.R
│   │   │   ├── test_metrics.R
│   │   │   ├── test_multithreading.R
│   │   │   ├── test_parameters.R
│   │   │   ├── test_utils.R
│   │   │   └── test_weighted_loss.R
│   │   └── testthat.R
│   └── vignettes/
│       └── basic_walkthrough.Rmd
├── README.md
├── SECURITY.md
├── VERSION.txt
├── biome.json
├── build-cran-package.sh
├── build-python.sh
├── build_r.R
├── cmake/
│   ├── IntegratedOpenCL.cmake
│   ├── Sanitizer.cmake
│   └── modules/
│       ├── FindLibR.cmake
│       └── FindNCCL.cmake
├── docker/
│   ├── README.md
│   ├── dockerfile-cli
│   ├── dockerfile-python
│   ├── dockerfile-r
│   └── gpu/
│       ├── README.md
│       ├── dockerfile-cli-only-distroless.gpu
│       ├── dockerfile-cli-only.gpu
│       └── dockerfile.gpu
├── docs/
│   ├── .lychee.toml
│   ├── Advanced-Topics.rst
│   ├── C-API.rst
│   ├── Development-Guide.rst
│   ├── Experiments.rst
│   ├── FAQ.rst
│   ├── Features.rst
│   ├── GPU-Performance.rst
│   ├── GPU-Targets.rst
│   ├── GPU-Tutorial.rst
│   ├── GPU-Windows.rst
│   ├── Installation-Guide.rst
│   ├── Key-Events.md
│   ├── Makefile
│   ├── Parallel-Learning-Guide.rst
│   ├── Parameters-Tuning.rst
│   ├── Parameters.rst
│   ├── Python-API.rst
│   ├── Python-Intro.rst
│   ├── Quick-Start.rst
│   ├── README.rst
│   ├── _static/
│   │   └── js/
│   │       └── script.js
│   ├── build-docs.sh
│   ├── conf.py
│   ├── env.yml
│   ├── gcc-Tips.rst
│   ├── index.rst
│   ├── logo/
│   │   ├── LightGBM-logo-hex.cdr
│   │   └── LightGBM_logo.cdr
│   └── make.bat
├── examples/
│   ├── README.md
│   ├── binary_classification/
│   │   ├── README.md
│   │   ├── binary.test
│   │   ├── binary.test.weight
│   │   ├── binary.train
│   │   ├── binary.train.weight
│   │   ├── forced_splits.json
│   │   ├── predict.conf
│   │   ├── train.conf
│   │   └── train_linear.conf
│   ├── lambdarank/
│   │   ├── README.md
│   │   ├── predict.conf
│   │   ├── rank.test
│   │   ├── rank.test.query
│   │   ├── rank.train
│   │   ├── rank.train.query
│   │   └── train.conf
│   ├── multiclass_classification/
│   │   ├── README.md
│   │   ├── multiclass.test
│   │   ├── multiclass.train
│   │   ├── predict.conf
│   │   └── train.conf
│   ├── parallel_learning/
│   │   ├── README.md
│   │   ├── binary.test
│   │   ├── binary.train
│   │   ├── predict.conf
│   │   └── train.conf
│   ├── python-guide/
│   │   ├── README.md
│   │   ├── advanced_example.py
│   │   ├── dask/
│   │   │   ├── README.md
│   │   │   ├── binary-classification.py
│   │   │   ├── multiclass-classification.py
│   │   │   ├── prediction.py
│   │   │   ├── ranking.py
│   │   │   └── regression.py
│   │   ├── dataset_from_multi_hdf5.py
│   │   ├── logistic_regression.py
│   │   ├── notebooks/
│   │   │   └── interactive_plot_example.ipynb
│   │   ├── plot_example.py
│   │   ├── simple_example.py
│   │   └── sklearn_example.py
│   ├── regression/
│   │   ├── README.md
│   │   ├── forced_bins.json
│   │   ├── forced_bins2.json
│   │   ├── predict.conf
│   │   ├── regression.test
│   │   ├── regression.test.init
│   │   ├── regression.train
│   │   ├── regression.train.init
│   │   └── train.conf
│   └── xendcg/
│       ├── README.md
│       ├── predict.conf
│       ├── rank.test
│       ├── rank.test.query
│       ├── rank.train
│       ├── rank.train.query
│       └── train.conf
├── include/
│   └── LightGBM/
│       ├── application.h
│       ├── arrow.h
│       ├── arrow.tpp
│       ├── bin.h
│       ├── boosting.h
│       ├── c_api.h
│       ├── config.h
│       ├── cuda/
│       │   ├── cuda_algorithms.hpp
│       │   ├── cuda_column_data.hpp
│       │   ├── cuda_metadata.hpp
│       │   ├── cuda_metric.hpp
│       │   ├── cuda_nccl_topology.hpp
│       │   ├── cuda_objective_function.hpp
│       │   ├── cuda_random.hpp
│       │   ├── cuda_rocm_interop.h
│       │   ├── cuda_row_data.hpp
│       │   ├── cuda_split_info.hpp
│       │   ├── cuda_tree.hpp
│       │   ├── cuda_utils.hu
│       │   └── vector_cudahost.h
│       ├── dataset.h
│       ├── dataset_loader.h
│       ├── export.h
│       ├── feature_group.h
│       ├── meta.h
│       ├── metric.h
│       ├── network.h
│       ├── objective_function.h
│       ├── prediction_early_stop.h
│       ├── sample_strategy.h
│       ├── train_share_states.h
│       ├── tree.h
│       ├── tree_learner.h
│       └── utils/
│           ├── array_args.h
│           ├── binary_writer.h
│           ├── byte_buffer.h
│           ├── chunked_array.hpp
│           ├── common.h
│           ├── file_io.h
│           ├── json11.h
│           ├── log.h
│           ├── openmp_wrapper.h
│           ├── pipeline_reader.h
│           ├── random.h
│           ├── text_reader.h
│           ├── threading.h
│           └── yamc/
│               ├── alternate_shared_mutex.hpp
│               ├── yamc_rwlock_sched.hpp
│               └── yamc_shared_lock.hpp
├── python-package/
│   ├── README.rst
│   ├── lightgbm/
│   │   ├── __init__.py
│   │   ├── basic.py
│   │   ├── callback.py
│   │   ├── compat.py
│   │   ├── dask.py
│   │   ├── engine.py
│   │   ├── libpath.py
│   │   ├── plotting.py
│   │   ├── py.typed
│   │   └── sklearn.py
│   └── pyproject.toml
├── src/
│   ├── application/
│   │   ├── application.cpp
│   │   └── predictor.hpp
│   ├── boosting/
│   │   ├── bagging.hpp
│   │   ├── boosting.cpp
│   │   ├── cuda/
│   │   │   ├── cuda_score_updater.cpp
│   │   │   ├── cuda_score_updater.cu
│   │   │   ├── cuda_score_updater.hpp
│   │   │   ├── nccl_gbdt.cpp
│   │   │   ├── nccl_gbdt.hpp
│   │   │   └── nccl_gbdt_component.hpp
│   │   ├── dart.hpp
│   │   ├── gbdt.cpp
│   │   ├── gbdt.h
│   │   ├── gbdt_model_text.cpp
│   │   ├── gbdt_prediction.cpp
│   │   ├── goss.hpp
│   │   ├── prediction_early_stop.cpp
│   │   ├── rf.hpp
│   │   ├── sample_strategy.cpp
│   │   └── score_updater.hpp
│   ├── c_api.cpp
│   ├── cuda/
│   │   ├── cuda_algorithms.cu
│   │   └── cuda_utils.cpp
│   ├── io/
│   │   ├── bin.cpp
│   │   ├── config.cpp
│   │   ├── config_auto.cpp
│   │   ├── cuda/
│   │   │   ├── cuda_column_data.cpp
│   │   │   ├── cuda_column_data.cu
│   │   │   ├── cuda_metadata.cpp
│   │   │   ├── cuda_row_data.cpp
│   │   │   ├── cuda_tree.cpp
│   │   │   └── cuda_tree.cu
│   │   ├── dataset.cpp
│   │   ├── dataset_loader.cpp
│   │   ├── dense_bin.hpp
│   │   ├── file_io.cpp
│   │   ├── json11.cpp
│   │   ├── metadata.cpp
│   │   ├── multi_val_dense_bin.hpp
│   │   ├── multi_val_sparse_bin.hpp
│   │   ├── parser.cpp
│   │   ├── parser.hpp
│   │   ├── sparse_bin.hpp
│   │   ├── train_share_states.cpp
│   │   └── tree.cpp
│   ├── main.cpp
│   ├── metric/
│   │   ├── binary_metric.hpp
│   │   ├── cuda/
│   │   │   ├── cuda_binary_metric.cpp
│   │   │   ├── cuda_binary_metric.hpp
│   │   │   ├── cuda_pointwise_metric.cpp
│   │   │   ├── cuda_pointwise_metric.cu
│   │   │   ├── cuda_pointwise_metric.hpp
│   │   │   ├── cuda_regression_metric.cpp
│   │   │   └── cuda_regression_metric.hpp
│   │   ├── dcg_calculator.cpp
│   │   ├── map_metric.hpp
│   │   ├── metric.cpp
│   │   ├── multiclass_metric.hpp
│   │   ├── rank_metric.hpp
│   │   ├── regression_metric.hpp
│   │   └── xentropy_metric.hpp
│   ├── network/
│   │   ├── linker_topo.cpp
│   │   ├── linkers.h
│   │   ├── linkers_mpi.cpp
│   │   ├── linkers_socket.cpp
│   │   ├── network.cpp
│   │   └── socket_wrapper.hpp
│   ├── objective/
│   │   ├── binary_objective.hpp
│   │   ├── cuda/
│   │   │   ├── cuda_binary_objective.cpp
│   │   │   ├── cuda_binary_objective.cu
│   │   │   ├── cuda_binary_objective.hpp
│   │   │   ├── cuda_multiclass_objective.cpp
│   │   │   ├── cuda_multiclass_objective.cu
│   │   │   ├── cuda_multiclass_objective.hpp
│   │   │   ├── cuda_rank_objective.cpp
│   │   │   ├── cuda_rank_objective.cu
│   │   │   ├── cuda_rank_objective.hpp
│   │   │   ├── cuda_regression_objective.cpp
│   │   │   ├── cuda_regression_objective.cu
│   │   │   └── cuda_regression_objective.hpp
│   │   ├── multiclass_objective.hpp
│   │   ├── objective_function.cpp
│   │   ├── rank_objective.hpp
│   │   ├── regression_objective.hpp
│   │   └── xentropy_objective.hpp
│   ├── treelearner/
│   │   ├── col_sampler.hpp
│   │   ├── cost_effective_gradient_boosting.hpp
│   │   ├── cuda/
│   │   │   ├── cuda_best_split_finder.cpp
│   │   │   ├── cuda_best_split_finder.cu
│   │   │   ├── cuda_best_split_finder.hpp
│   │   │   ├── cuda_data_partition.cpp
│   │   │   ├── cuda_data_partition.cu
│   │   │   ├── cuda_data_partition.hpp
│   │   │   ├── cuda_gradient_discretizer.cu
│   │   │   ├── cuda_gradient_discretizer.hpp
│   │   │   ├── cuda_histogram_constructor.cpp
│   │   │   ├── cuda_histogram_constructor.cu
│   │   │   ├── cuda_histogram_constructor.hpp
│   │   │   ├── cuda_leaf_splits.cpp
│   │   │   ├── cuda_leaf_splits.cu
│   │   │   ├── cuda_leaf_splits.hpp
│   │   │   ├── cuda_single_gpu_tree_learner.cpp
│   │   │   ├── cuda_single_gpu_tree_learner.cu
│   │   │   └── cuda_single_gpu_tree_learner.hpp
│   │   ├── data_parallel_tree_learner.cpp
│   │   ├── data_partition.hpp
│   │   ├── feature_histogram.cpp
│   │   ├── feature_histogram.hpp
│   │   ├── feature_parallel_tree_learner.cpp
│   │   ├── gpu_tree_learner.cpp
│   │   ├── gpu_tree_learner.h
│   │   ├── gradient_discretizer.cpp
│   │   ├── gradient_discretizer.hpp
│   │   ├── leaf_splits.hpp
│   │   ├── linear_tree_learner.cpp
│   │   ├── linear_tree_learner.h
│   │   ├── monotone_constraints.hpp
│   │   ├── ocl/
│   │   │   ├── histogram16.cl
│   │   │   ├── histogram256.cl
│   │   │   └── histogram64.cl
│   │   ├── parallel_tree_learner.h
│   │   ├── serial_tree_learner.cpp
│   │   ├── serial_tree_learner.h
│   │   ├── split_info.hpp
│   │   ├── tree_learner.cpp
│   │   └── voting_parallel_tree_learner.cpp
│   └── utils/
│       └── openmp_wrapper.cpp
├── swig/
│   ├── ChunkedArray_API_extensions.i
│   ├── StringArray.hpp
│   ├── StringArray.i
│   ├── StringArray_API_extensions.i
│   ├── lightgbmlib.i
│   └── pointer_manipulation.i
├── tests/
│   ├── c_api_test/
│   │   └── test_.py
│   ├── cpp_tests/
│   │   ├── predict.conf
│   │   ├── test.py
│   │   ├── test_array_args.cpp
│   │   ├── test_arrow.cpp
│   │   ├── test_byte_buffer.cpp
│   │   ├── test_chunked_array.cpp
│   │   ├── test_common.cpp
│   │   ├── test_main.cpp
│   │   ├── test_serialize.cpp
│   │   ├── test_single_row.cpp
│   │   ├── test_stream.cpp
│   │   ├── testutils.cpp
│   │   ├── testutils.h
│   │   └── train.conf
│   ├── data/
│   │   └── categorical.data
│   ├── distributed/
│   │   ├── _test_distributed.py
│   │   └── conftest.py
│   └── python_package_test/
│       ├── __init__.py
│       ├── conftest.py
│       ├── test_arrow.py
│       ├── test_basic.py
│       ├── test_callback.py
│       ├── test_consistency.py
│       ├── test_dask.py
│       ├── test_dual.py
│       ├── test_engine.py
│       ├── test_plotting.py
│       ├── test_sklearn.py
│       ├── test_utilities.py
│       └── utils.py
└── windows/
    ├── LightGBM.sln
    ├── LightGBM.vcxproj
    └── LightGBM.vcxproj.filters

================================================
FILE CONTENTS
================================================

================================================
FILE: .appveyor.yml
================================================
version: 4.6.0.99.{build}

image: Visual Studio 2017
platform: x64
configuration:
  - '3.9'

# only build on 'master' and pull requests targeting it
branches:
  only:
    - master

environment:
  matrix:
    - COMPILER: MSVC
      TASK: python
    - COMPILER: MINGW
      TASK: python

clone_depth: 5

install:
  - git submodule update --init --recursive  # get `external_libs` folder
  - set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%
  - set PYTHON_VERSION=%CONFIGURATION%
  - ps: |
      $env:APPVEYOR = "true"
      $env:CMAKE_BUILD_PARALLEL_LEVEL = 4
      $env:MINICONDA = "C:\Miniconda3-x64"
      $env:PATH = "$env:MINICONDA;$env:MINICONDA\Scripts;$env:PATH"
      $env:BUILD_SOURCESDIRECTORY = "$env:APPVEYOR_BUILD_FOLDER"
      # tell scripts where to put artifacts
      # (this variable name is left over from when jobs ran on Azure DevOps)
      $env:BUILD_ARTIFACTSTAGINGDIRECTORY = "$env:APPVEYOR_BUILD_FOLDER/artifacts"

build: false

test_script:
  - conda config --remove channels defaults
  - conda config --add channels nodefaults
  - conda config --add channels conda-forge
  - conda config --set channel_priority strict
  - conda init powershell
  - powershell.exe -ExecutionPolicy Bypass -File %APPVEYOR_BUILD_FOLDER%\.ci\test-windows.ps1


================================================
FILE: .ci/README.md
================================================
Helper Scripts for CI
=====================

This folder contains scripts which are run on CI services.

Dockerfile used on CI service is maintained in a separate [GitHub repository](https://github.com/guolinke/lightgbm-ci-docker) and can be pulled from [Docker Hub](https://hub.docker.com/r/lightgbm/vsts-agent).


================================================
FILE: .ci/append-comment.sh
================================================
#!/bin/bash
#
# [description]
#     Post a comment to a pull request.
#
# [usage]
#     append-comment.sh <PULL_REQUEST_ID> <BODY>
#
# PULL_REQUEST_ID: ID of PR to post the comment on.
#
# BODY: Text of the comment to be posted.

set -e -E -u -o pipefail

if [ -z "$GITHUB_ACTIONS" ]; then
  echo "Must be run inside GitHub Actions CI"
  exit 1
fi

if [ $# -ne 2 ]; then
  echo "Usage: $0 <PULL_REQUEST_ID> <BODY>"
  exit 1
fi

pr_id=$1
body=$2

body=${body/failure/failure ❌}
body=${body/error/failure ❌}
body=${body/cancelled/failure ❌}
body=${body/timed_out/failure ❌}
body=${body/success/success ✔️}
data=$(
  jq -n \
    --argjson body "\"$body\"" \
    '{"body": $body}'
)
curl -sL \
  --fail \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -d "$data" \
  "${GITHUB_API_URL}/repos/lightgbm-org/LightGBM/issues/${pr_id}/comments"


================================================
FILE: .ci/build-docs.sh
================================================
#!/bin/bash

set -e -E -u -o pipefail

conda env create \
    --name test-env \
    --file ./docs/env.yml \
|| exit 1

# shellcheck disable=SC1091
source activate test-env

make -C docs html || exit 1


================================================
FILE: .ci/check-dynamic-dependencies.sh
================================================
#!/bin/bash
#
# [description]
#     Helper script for checking versions in the dynamic symbol table.
#     This script checks that LightGBM library is linked to the appropriate symbol versions.
#     Linking to newer symbol versions at compile time is problematic because it could result
#     in built artifacts being unusable on older platforms.
#
#     Version history for these symbols can be found at the following:
#         * GLIBC: https://sourceware.org/glibc/wiki/Glibc%20Timeline
#         * GLIBCXX: https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
#         * OMP/GOMP: https://github.com/gcc-mirror/gcc/blob/master/libgomp/libgomp.map
#
# [usage]
#     check-dynamic-dependencies.sh <PATH>
#
# PATH: Path to the file.
#       Path to the file with the dynamic symbol table entries of the file
#       (result of `objdump -T` command).

set -e -E -u -o pipefail

if [ "$#" -ne 1 ]; then
    echo "Usage: $0 <PATH>"
    exit 1
fi

INPUT_FILE="$1"

if [ ! -f "$INPUT_FILE" ]; then
    echo "Error: File '$INPUT_FILE' not found."
    exit 1
fi

awk '
BEGIN {
    glibc_count = 0
    glibcxx_count = 0
    gomp_count = 0

    has_error = 0
}

# --- Check GLIBC ---
/0{16}[ \t\(]+GLIBC_[0-9]+\.[0-9]+/ {
    match($0, /GLIBC_([0-9]+)\.([0-9]+)/, parts)
    if (RSTART > 0) {
        match($0, /GLIBC_[0-9]+\.[0-9]+/)
        ver_str = substr($0, RSTART+6, RLENGTH-6)  # skip "GLIBC_"
        split(ver_str, v, ".")
        major = v[1] + 0
        minor = v[2] + 0

        glibc_count++

        if (major > 2 || (major == 2 && minor > 28)) {
            print "Error: found unexpected GLIBC version: \x27" major "." minor "\x27"
            has_error = 1
        }
    }
}

# --- Check GLIBCXX ---
/0{16}[ \t\(]+GLIBCXX_[0-9]+\.[0-9]+/ {
    match($0, /GLIBCXX_[0-9]+\.[0-9]+(\.[0-9]+)?/)
    if (RSTART > 0) {
        ver_str = substr($0, RSTART+8, RLENGTH-8)  # skip "GLIBCXX_"
        n = split(ver_str, v, ".")
        major = v[1] + 0
        minor = v[2] + 0
        patch = (n >= 3) ? v[3] + 0 : 0
        patch_str = (n >= 3) ? v[3] : ""

        glibcxx_count++

        msg_ver = major "." minor
        if (n >= 3) msg_ver = msg_ver "." patch

        if (major != 3 || minor != 4) {
             print "Error: found unexpected GLIBCXX version: \x27" msg_ver "\x27"
             has_error = 1
        }
        if (n >= 3 && patch > 22) {
             print "Error: found unexpected GLIBCXX version: \x27" msg_ver "\x27"
             has_error = 1
        }
    }
}

# --- Check OMP/GOMP ---
/0{16}[ \t\(]+G?OMP_[0-9]+\.[0-9]+/ {
    match($0, /G?OMP_[0-9]+\.[0-9]+/)
    if (RSTART > 0) {
        full_match = substr($0, RSTART, RLENGTH)
        us_idx = index(full_match, "_")
        ver_str = substr(full_match, us_idx + 1)

        split(ver_str, v, ".")
        major = v[1] + 0
        minor = v[2] + 0

        gomp_count++

        if (major > 4 || (major == 4 && minor > 5)) {
            print "Error: found unexpected OMP/GOMP version: \x27" major "." minor "\x27"
            has_error = 1
        }
    }
}

END {
    if (glibc_count <= 1) {
        print "Error: Not enough GLIBC symbols found (found " glibc_count ", expected > 1)"
        has_error = 1
    }
    if (glibcxx_count <= 1) {
        print "Error: Not enough GLIBCXX symbols found (found " glibcxx_count ", expected > 1)"
        has_error = 1
    }
    if (gomp_count <= 1) {
        print "Error: Not enough OMP/GOMP symbols found (found " gomp_count ", expected > 1)"
        has_error = 1
    }

    if (has_error == 1) {
        exit 1
    }
}
' "$INPUT_FILE"


================================================
FILE: .ci/check-omp-pragmas.sh
================================================
#!/bin/bash

set -e -u

echo "checking that all OpenMP pragmas specify num_threads()"
get_omp_pragmas_without_num_threads() {
    grep \
        -n \
        -R \
        --include='*.c' \
        --include='*.cc' \
        --include='*.cpp' \
        --include='*.h' \
        --include='*.hpp' \
        'pragma omp parallel' \
    | grep -v ' num_threads'
}

# 'grep' returns a non-0 exit code if 0 lines were found.
# Turning off '-e -o pipefail' options here so that bash doesn't
# consider this a failure and stop execution of the script.
#
# ref: https://www.gnu.org/software/grep/manual/html_node/Exit-Status.html
set +e
PROBLEMATIC_LINES=$(
    get_omp_pragmas_without_num_threads
)
set -e
if test "${PROBLEMATIC_LINES}" != ""; then
    get_omp_pragmas_without_num_threads
    echo "Found '#pragma omp parallel' not using explicit num_threads() configuration. Fix those."
    echo "For details, see https://www.openmp.org/spec-html/5.0/openmpse14.html#x54-800002.6"
    exit 1
fi
echo "done checking OpenMP pragmas"


================================================
FILE: .ci/check-python-dists.sh
================================================
#!/bin/sh

set -e -u

DIST_DIR=${1}

# defaults
METHOD=${METHOD:-""}
TASK=${TASK:-""}

echo "checking Python-package distributions in '${DIST_DIR}'"

pip install \
    -qq \
    check-wheel-contents \
    twine || exit 1

echo "twine check..."
twine check --strict "$(echo "${DIST_DIR}"/*)" || exit 1

if { test "${TASK}" = "bdist" || test "${METHOD}" = "wheel"; }; then
    echo "check-wheel-contents..."
    check-wheel-contents "$(echo "${DIST_DIR}"/*.whl)" || exit 1
fi

PY_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)")
if [ "$PY_MINOR_VER" -gt 7 ]; then
    echo "pydistcheck..."
    pip install 'pydistcheck>=0.9.1'
    if { test "${TASK}" = "cuda" || test "${METHOD}" = "wheel"; }; then
        pydistcheck \
            --inspect \
            --ignore 'compiled-objects-have-debug-symbols'\
            --ignore 'distro-too-large-compressed' \
            --max-allowed-size-uncompressed '500M' \
            --max-allowed-files 800 \
            "$(echo "${DIST_DIR}"/*)" || exit 1
    elif { test "$(uname -m)" = "aarch64"; }; then
        pydistcheck \
            --inspect \
            --ignore 'compiled-objects-have-debug-symbols' \
            --max-allowed-size-compressed '5M' \
            --max-allowed-size-uncompressed '15M' \
            --max-allowed-files 800 \
            "$(echo "${DIST_DIR}"/*)" || exit 1
    else
        pydistcheck \
            --inspect \
            --max-allowed-size-compressed '5M' \
            --max-allowed-size-uncompressed '15M' \
            --max-allowed-files 800 \
            "$(echo "${DIST_DIR}"/*)" || exit 1
    fi
else
    echo "skipping pydistcheck (does not support Python 3.${PY_MINOR_VER})"
fi

echo "done checking Python-package distributions"


================================================
FILE: .ci/check-workflow-status.sh
================================================
#!/bin/bash

# [description]
#
#   Look for the last run of a given GitHub Actions workflow on a given branch.
#   If there's never been one (as might be the case with optional workflows like valgrind),
#   exit with 0.
#
#   Otherwise, check the status of that latest run.
#   If it wasn't successful, exit with a non-0 exit code.
#
# [usage]
#
#     check-workflow-status.sh <BRANCH> <WORKFLOW_FILE>
#
# BRANCH: name of a branch involved in a pull request.
#
# WORKFLOW_FILE: filename (e.g. 'r_valgrind.yml') defining the GitHub Actions workflow.
#

set -e -u -o pipefail

BRANCH="${1}"
WORKFLOW_FILE="${2}"
PR_NUMBER="${3}"

# Limit how much data is pulled from the API and needs to be parsed locally.
OLDEST_ALLOWED_RUN_DATE=$(date --date='7 days ago' '+%F')

echo "Searching for latest run of '${WORKFLOW_FILE}' on branch '${BRANCH}' "

LATEST_RUN_ID=$(
    gh run list  \
        --repo 'lightgbm-org/LightGBM' \
        --event 'workflow_dispatch' \
        --created ">= ${OLDEST_ALLOWED_RUN_DATE}" \
        --workflow "${WORKFLOW_FILE}" \
        --json 'createdAt,databaseId,name' \
        --jq "sort_by(.createdAt) | reverse | map(select(.name | contains (\"pr=${PR_NUMBER}\"))) | .[0] | .databaseId"
)

if [[ "${LATEST_RUN_ID}" == "" ]]; then
    echo "No runs of '${WORKFLOW_FILE}' found on branch from pull request ${PR_NUMBER} (on or after ${OLDEST_ALLOWED_RUN_DATE})."
    exit 0
fi

echo "Checking status of workflow run '${LATEST_RUN_ID}'"
gh run view \
    --repo "lightgbm-org/LightGBM" \
    --exit-status \
    "${LATEST_RUN_ID}"


================================================
FILE: .ci/conda-envs/README.md
================================================
# conda-envs

This directory contains files used to create `conda` environments for development
and testing of LightGBM.

The `.txt` files here are intended to be used with `conda create --file`.

For details on that, see the `conda` docs:

* `conda create` docs ([link](https://conda.io/projects/conda/en/latest/commands/create.html))
* "Managing Environments" ([link](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html))


================================================
FILE: .ci/conda-envs/ci-core-py39.txt
================================================
# [description]
#
#   Similar to ci-core.txt, but specific to Python 3.9.
#
#   Unlike ci-core.txt, this includes a Python version and uses
#   `=` and `<=` pins to make solves faster and prevent against
#   issues like https://github.com/lightgbm-org/LightGBM/pull/6370.
#
# [usage]
#
#   conda create \
#     --name test-env \
#     --file ./.ci/conda-envs/ci-core-py39.txt
#

# python
python=3.9.*

# direct imports
cffi=1.15.*
# dask and distributed versions below are the first versions that support tornado >=6.2
# which is required for testing
dask=2022.12.*
distributed=2022.12.*
joblib=1.3.*
matplotlib-base=3.5.*
numpy=1.22.*
pandas=1.3.*
pyarrow=9.0.*
python-graphviz=0.20.*
scikit-learn=1.0.*
scipy=1.7.*

# testing-only dependencies
cloudpickle=2.2.*
pluggy=1.0.*
psutil=5.9.3
pytest=7.4.*

# https://github.com/lightgbm-org/LightGBM/issues/6990
graphite2=1.3.14=*_0

# other recursive dependencies, just
# pinned here to help speed up solves
bokeh=2.4.*
fsspec=2023.1.*
msgpack-python=1.0.*
pytz=2024.1
setuptools=59.8.*
snappy=1.1.*
tomli=2.0.*
tornado=6.2.*
wheel=0.42.*
zict=2.2.*
zipp=3.15.*


================================================
FILE: .ci/conda-envs/ci-core.txt
================================================
# [description]
#
#   Core dependencies used across most LightGBM continuous integration (CI) jobs.
#
#   'python' constraint is intentionally omitted, so this file can be reused across
#   Python versions.
#
#   These floors are not the oldest versions LightGBM supports... they're here just to make conda
#   solves faster, and should generally be the latest versions that work for all CI jobs using this.
#
# [usage]
#
#   conda create \
#     --name test-env \
#     --file ./.ci/conda-envs/ci-core.txt \
#     python=3.10
#

# direct imports
cffi>=1.16
dask>=2023.5.0,<2024.12
joblib>=1.3.2
matplotlib-base>=3.7.3
numpy>=1.24.4
pandas>2.0
pyarrow-core>=6.0
python-graphviz>=0.20.3
scikit-learn>=1.3.2
scipy>=1.1

# testing-only dependencies
cloudpickle>=3.0.0
psutil>=5.9.8
pytest>=8.1.1

# other recursive dependencies, just
# pinned here to help speed up solves
pluggy>=1.4.0
setuptools>=69.2
wheel>=0.43


================================================
FILE: .ci/create-nuget.py
================================================
# coding: utf-8
"""Script for generating files with NuGet package metadata."""

import datetime
import sys
from pathlib import Path
from shutil import copyfile

if __name__ == "__main__":
    source = Path(sys.argv[1])
    nuget_dir = Path(__file__).absolute().parent / "nuget"
    print(f"Creating nuget directory '{nuget_dir}'")
    linux_folder_path = nuget_dir / "runtimes" / "linux-x64" / "native"
    linux_folder_path.mkdir(parents=True, exist_ok=True)
    osx_folder_path = nuget_dir / "runtimes" / "osx-x64" / "native"
    osx_folder_path.mkdir(parents=True, exist_ok=True)
    windows_folder_path = nuget_dir / "runtimes" / "win-x64" / "native"
    windows_folder_path.mkdir(parents=True, exist_ok=True)
    build_folder_path = nuget_dir / "build"
    build_folder_path.mkdir(parents=True, exist_ok=True)
    print(f"Looking for libraries in '{source}'")
    copyfile(source / "lib_lightgbm.so", linux_folder_path / "lib_lightgbm.so")
    copyfile(source / "lib_lightgbm.dylib", osx_folder_path / "lib_lightgbm.dylib")
    copyfile(source / "lib_lightgbm.dll", windows_folder_path / "lib_lightgbm.dll")
    copyfile(source / "lightgbm.exe", windows_folder_path / "lightgbm.exe")
    version = (nuget_dir.parents[1] / "VERSION.txt").read_text(encoding="utf-8").strip().replace("rc", "-rc")
    print(f"Setting version to '{version}'")
    nuget_str = rf"""<?xml version="1.0"?>
    <package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
    <metadata>
        <id>LightGBM</id>
        <version>{version}</version>
        <authors>Guolin Ke</authors>
        <owners>Guolin Ke</owners>
        <license type="expression">MIT</license>
        <projectUrl>https://github.com/lightgbm-org/LightGBM</projectUrl>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>A fast, distributed, high performance gradient boosting framework</description>
        <copyright>Copyright {datetime.datetime.now().year} @ Microsoft</copyright>
        <tags>machine-learning data-mining distributed native boosting gbdt</tags>
        <dependencies> </dependencies>
    </metadata>
        <files>
        <file src="build\**" target="build"/>
        <file src="runtimes\**" target="runtimes"/>
        </files>
    </package>
    """
    prop_str = r"""
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup Condition="Exists('packages.config') OR
                            Exists('$(MSBuildProjectName).packages.config') OR
                            Exists('packages.$(MSBuildProjectName).config')">
        <Content Include="$(MSBuildThisFileDirectory)/../runtimes/win-x64/native/*.dll"
                Condition="'$(PlatformTarget)' == 'x64'">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <Visible>false</Visible>
        </Content>
        <Content Include="$(MSBuildThisFileDirectory)/../runtimes/win-x64/native/*.exe"
                Condition="'$(PlatformTarget)' == 'x64'">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        <Visible>false</Visible>
        </Content>
    </ItemGroup>
    </Project>
    """
    target_str = r"""
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <EnableLightGBMUnsupportedPlatformTargetCheck Condition="'$(EnableLightGBMUnsupportedPlatformTargetCheck)' == ''">true</EnableLightGBMUnsupportedPlatformTargetCheck>
    </PropertyGroup>
    <Target Name="_LightGBMCheckForUnsupportedPlatformTarget"
            Condition="'$(EnableLightGBMUnsupportedPlatformTargetCheck)' == 'true'"
            AfterTargets="_CheckForInvalidConfigurationAndPlatform">
        <Error Condition="'$(PlatformTarget)' != 'x64' AND
                        ('$(OutputType)' == 'Exe' OR '$(OutputType)'=='WinExe') AND
                        !('$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(PlatformTarget)' == '')"
            Text="LightGBM currently supports 'x64' processor architectures. Please ensure your application is targeting 'x64'." />
    </Target>
    </Project>
    """
    (nuget_dir / "LightGBM.nuspec").write_text(nuget_str, encoding="utf-8")
    (nuget_dir / "build" / "LightGBM.props").write_text(prop_str, encoding="utf-8")
    (nuget_dir / "build" / "LightGBM.targets").write_text(target_str, encoding="utf-8")
    print("Done creating NuGet package")


================================================
FILE: .ci/download-artifacts.sh
================================================
#!/bin/bash

# [description]
#     Collect and download artifacts from all workflow runs for a commit.
#
# [usage]
#     ./download-artifacts.sh <COMMIT_ID>
#

set -e -u -E -o pipefail

COMMIT_ID="${1}"
OUTPUT_DIR="./release-artifacts"

get-latest-run-id() {
     gh run list                      \
        --repo "lightgbm-org/LightGBM"   \
        --commit "${1}"               \
        --workflow "${2}"             \
        --json 'createdAt,databaseId' \
        --jq 'sort_by(.createdAt) | reverse | .[0] | .databaseId'
}

# ensure directory for storing artifacts exists
echo "preparing to download artifacts for commit '${COMMIT_ID}' to '${OUTPUT_DIR}'"
mkdir -p "${OUTPUT_DIR}"

# get core artifacts
echo "downloading core artifacts"
gh run download \
    --repo "lightgbm-org/LightGBM" \
    --dir "${OUTPUT_DIR}" \
    "$(get-latest-run-id "${COMMIT_ID}" 'build.yml')"
echo "done downloading core artifacts"

# get python-package artifacts
echo "downloading python-package artifacts and NuGet package"
gh run download \
    --repo "lightgbm-org/LightGBM" \
    --dir "${OUTPUT_DIR}" \
    "$(get-latest-run-id "${COMMIT_ID}" 'python_package.yml')"
echo "done downloading python-package artifacts and NuGet package"

# get R-package artifacts
echo "downloading R-package artifacts"
gh run download \
    --repo "lightgbm-org/LightGBM" \
    --dir "${OUTPUT_DIR}" \
    "$(get-latest-run-id "${COMMIT_ID}" 'r_package.yml')"
echo "done downloading R-package artifacts"

# get SWIG artifacts
echo "downloading SWIG artifacts"
gh run download \
    --repo "lightgbm-org/LightGBM" \
    --dir "${OUTPUT_DIR}" \
    "$(get-latest-run-id "${COMMIT_ID}" 'swig.yml')"
echo "done downloading SWIG artifacts"

# 'gh run download' unpackages into nested directories like {artifact-name}/{file}.
#
# This moves all files to the top level and then deletes those {artifact-name}/ directories,
# to make it easier to bulk upload all files to a release.
echo "flattening directory structure"
find "${OUTPUT_DIR}" -type f -mindepth 2 -exec mv -i '{}' "${OUTPUT_DIR}" \;
find "${OUTPUT_DIR}" -type d -mindepth 1 -exec rm -r '{}' \+

echo "downloaded artifacts:"
find "${OUTPUT_DIR}" -type f


================================================
FILE: .ci/install-opencl.ps1
================================================
Write-Output "Installing OpenCL CPU platform"

$installer = "AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x64.exe"

Write-Output "Downloading OpenCL platform installer"
$ProgressPreference = "SilentlyContinue"  # progress bar bug extremely slows down download speed
$params = @{
    OutFile = "$installer"
    Uri = "https://github.com/lightgbm-org/LightGBM/releases/download/v2.0.12/$installer"
}
Invoke-WebRequest @params

if (Test-Path "$installer") {
    Write-Output "Successfully downloaded OpenCL platform installer"
} else {
    Write-Output "Unable to download OpenCL platform installer"
    Write-Output "Setting EXIT"
    $host.SetShouldExit(-1)
    exit 1
}

# Install OpenCL platform from installer executable
Write-Output "Running OpenCL installer"
Invoke-Command -ScriptBlock {
    Start-Process "$installer" -ArgumentList '/S /V"/quiet /norestart /passive /log opencl.log"' -Wait
}

$property = Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors
if ($null -eq $property) {
    Write-Output "Unable to install OpenCL CPU platform"
    Write-Output "OpenCL installation log:"
    Get-Content "opencl.log"
    Write-Output "Setting EXIT"
    $host.SetShouldExit(-1)
    exit 1
} else {
    Write-Output "Successfully installed OpenCL CPU platform"
    Write-Output "Current OpenCL drivers:"
    Write-Output $property
}


================================================
FILE: .ci/install-r-deps.R
================================================
# Install R dependencies, using only base R.
#
# Supported arguments:
#
#  --all                     Install all the 'Depends', 'Imports', 'LinkingTo', and 'Suggests' dependencies
#                            (automatically implies --build --test).
#
#  --build                   Install the packages needed to build.
#
#  --exclude=<pkg1,pkg2,...> Comma-delimited list of packages to NOT install.
#
#  --include=<pkg1,pkg2,...> Comma-delimited list of additional packages to install.
#                            These will always be installed, unless also used in "--exclude".
#
#  --test                    Install packages needed to run tests.
#


# [description] Parse command line arguments into an R list.
#               Returns a list where keys are arguments and values
#               are either TRUE (for flags) or a vector of values passed via a
#               comma-delimited list.
.parse_args <- function(args) {
    out <- list(
        "--all"       = FALSE
        , "--build"   = FALSE
        , "--exclude" = character(0L)
        , "--include" = character(0L)
        , "--test"    = FALSE
    )
    for (arg in args) {
        parsed_arg <- unlist(strsplit(arg, "=", fixed = TRUE))
        arg_name <- parsed_arg[[1L]]
        if (!(arg_name %in% names(out))) {
            stop(sprintf("Unrecognized argument: '%s'", arg_name))
        }
        if (length(parsed_arg) == 2L) {
            # lists, like "--include=roxygen2,testthat"
            values <- unlist(strsplit(parsed_arg[[2L]], ",", fixed = TRUE))
            out[[arg_name]] <- values
        } else {
            # flags, like "--build"
            out[[arg]] <- TRUE
        }
    }
    return(out)
}

args <- .parse_args(
    commandArgs(trailingOnly = TRUE)
)

# which dependencies to install
ALL_DEPS     <- isTRUE(args[["--all"]])
BUILD_DEPS   <- ALL_DEPS || isTRUE(args[["--build"]])
TEST_DEPS    <- ALL_DEPS || isTRUE(args[["--test"]])

# force downloading of binary packages on macOS
COMPILE_FROM_SOURCE <- "both"
PACKAGE_TYPE <- getOption("pkgType")

# CRAN has precompiled binaries for macOS and Windows... prefer those,
# for faster installation.
if (Sys.info()[["sysname"]] == "Darwin" || .Platform$OS.type == "windows") {
    COMPILE_FROM_SOURCE <- "never"
    PACKAGE_TYPE <- "binary"
}
options(
    install.packages.check.source = "no"
    , install.packages.compile.from.source = COMPILE_FROM_SOURCE
)

# always use the same CRAN mirror
CRAN_MIRROR <- Sys.getenv("CRAN_MIRROR", unset = "https://cran.r-project.org")

# we always want these
deps_to_install <- c(
    "data.table"
    , "jsonlite"
    , "Matrix"
    , "R6"
)

if (isTRUE(BUILD_DEPS)) {
    deps_to_install <- c(
        deps_to_install
        , "knitr"
        , "markdown"
    )
}

if (isTRUE(TEST_DEPS)) {
    deps_to_install <- c(
        deps_to_install
        , "RhpcBLASctl"
        , "testthat"
    )
}

# add packages passed through '--include'
deps_to_install <- unique(c(
    deps_to_install
    , args[["--include"]]
))

# remove packages passed through '--exclude'
deps_to_install <- setdiff(
    x = deps_to_install
    , args[["--exclude"]]
)

msg <- sprintf(
    "[install-r-deps] installing R packages: %s\n"
    , toString(sort(deps_to_install))
)
cat(msg)

install.packages(  # nolint: undesirable_function.
    pkgs = deps_to_install
    , dependencies = c("Depends", "Imports", "LinkingTo")
    , lib = Sys.getenv("R_LIB_PATH", unset = .libPaths()[[1L]])
    , repos = CRAN_MIRROR
    , type = PACKAGE_TYPE
    , Ncpus = parallel::detectCores()
)


================================================
FILE: .ci/lint-all.sh
================================================
#!/bin/bash

set -e -E -u -o pipefail

pwsh -command "Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -SkipPublisherCheck"
echo "Linting PowerShell code"
pwsh -file ./.ci/lint-powershell.ps1 || exit 1

conda create -q -y -n test-env \
    "python=3.13[build=*_cp*]" \
    'pre-commit>=3.8.0' \
    'r-lintr>=3.3.0'

# shellcheck disable=SC1091
source activate test-env

echo "Running pre-commit checks"
pre-commit run --all-files || exit 1

echo "Linting R code"
Rscript ./.ci/lint-r-code.R "$(pwd)" || exit 1


================================================
FILE: .ci/lint-powershell.ps1
================================================
$ErrorActionPreference = 'Stop'

$settings = @{
    Severity = @(
        'Information',
        'Warning',
        'Error'
    )
    IncludeDefaultRules = $true
    # Additional rules that are disabled by default
    Rules = @{
        PSAvoidExclaimOperator = @{
            Enable = $true
        }
        PSAvoidLongLines = @{
            Enable = $true
            MaximumLineLength = 120
        }
        PSAvoidSemicolonsAsLineTerminators = @{
            Enable = $true
        }
        PSPlaceCloseBrace = @{
            Enable = $true
            NoEmptyLineBefore = $true
            IgnoreOneLineBlock = $true
            NewLineAfter = $false
        }
        PSPlaceOpenBrace = @{
            Enable = $true
            OnSameLine = $true
            NewLineAfter = $true
            IgnoreOneLineBlock = $true
        }
        PSUseConsistentIndentation = @{
            Enable = $true
            IndentationSize = 4
            PipelineIndentation = 'IncreaseIndentationAfterEveryPipeline'
            Kind = 'space'
        }
        PSUseConsistentWhitespace = @{
            Enable = $true
            CheckInnerBrace = $true
            CheckOpenBrace = $true
            CheckOpenParen = $true
            CheckOperator = $true
            CheckSeparator = $true
            CheckPipe = $true
            CheckPipeForRedundantWhitespace = $true
            CheckParameter = $true
            IgnoreAssignmentOperatorInsideHashTable = $false
        }
        PSUseCorrectCasing = @{
            Enable = $true
        }
    }
}

Invoke-ScriptAnalyzer -Path ./ -Recurse -EnableExit -Settings $settings


================================================
FILE: .ci/lint-r-code.R
================================================
loadNamespace("lintr")

args <- commandArgs(
    trailingOnly = TRUE
)
SOURCE_DIR <- args[[1L]]

FILES_TO_LINT <- list.files(
    path = SOURCE_DIR
    , pattern = "\\.r$|\\.rmd$"
    , all.files = TRUE
    , ignore.case = TRUE
    , full.names = TRUE
    , recursive = TRUE
    , include.dirs = FALSE
)

# text to use for pipe operators from packages like 'magrittr'
pipe_text <- paste0(
    "For consistency and the sake of being explicit, this project's code "
    , "does not use the pipe operator."
)

# text to use for functions that should only be called interactively
interactive_text <- paste0(
    "Functions like '?', 'help', and 'install.packages()' should only be used "
    , "interactively, not in package code."
)

LINTERS_TO_USE <- list(
    "absolute_path"          = lintr::absolute_path_linter()
    , "any_duplicated"       = lintr::any_duplicated_linter()
    , "any_is_na"            = lintr::any_is_na_linter()
    , "assignment"           = lintr::assignment_linter()
    , "backport"             = lintr::backport_linter()
    , "boolean_arithmetic"   = lintr::boolean_arithmetic_linter()
    , "braces"               = lintr::brace_linter()
    , "class_equals"         = lintr::class_equals_linter()
    , "commas"               = lintr::commas_linter()
    , "conjunct_test"        = lintr::conjunct_test_linter()
    , "duplicate_argument"   = lintr::duplicate_argument_linter()
    , "empty_assignment"     = lintr::empty_assignment_linter()
    , "equals_na"            = lintr::equals_na_linter()
    , "fixed_regex"          = lintr::fixed_regex_linter()
    , "for_loop_index"       = lintr::for_loop_index_linter()
    , "function_left"        = lintr::function_left_parentheses_linter()
    , "function_return"      = lintr::function_return_linter()
    , "implicit_assignment"  = lintr::implicit_assignment_linter()
    , "implicit_integers"    = lintr::implicit_integer_linter()
    , "infix_spaces"         = lintr::infix_spaces_linter()
    , "inner_combine"        = lintr::inner_combine_linter()
    , "is_numeric"           = lintr::is_numeric_linter()
    , "lengths"              = lintr::lengths_linter()
    , "length_levels"        = lintr::length_levels_linter()
    , "length_test"          = lintr::length_test_linter()
    , "line_length"          = lintr::line_length_linter(length = 120L)
    , "literal_coercion"     = lintr::literal_coercion_linter()
    , "matrix"               = lintr::matrix_apply_linter()
    , "missing_argument"     = lintr::missing_argument_linter()
    , "non_portable_path"    = lintr::nonportable_path_linter()
    , "numeric_leading_zero" = lintr::numeric_leading_zero_linter()
    , "outer_negation"       = lintr::outer_negation_linter()
    , "package_hooks"        = lintr::package_hooks_linter()
    , "paren_body"           = lintr::paren_body_linter()
    , "paste"                = lintr::paste_linter()
    , "quotes"               = lintr::quotes_linter()
    , "redundant_equals"     = lintr::redundant_equals_linter()
    , "regex_subset"         = lintr::regex_subset_linter()
    , "routine_registration" = lintr::routine_registration_linter()
    , "scalar_in"            = lintr::scalar_in_linter()
    , "semicolon"            = lintr::semicolon_linter()
    , "seq"                  = lintr::seq_linter()
    , "spaces_inside"        = lintr::spaces_inside_linter()
    , "spaces_left_parens"   = lintr::spaces_left_parentheses_linter()
    , "sprintf"              = lintr::sprintf_linter()
    , "string_boundary"      = lintr::string_boundary_linter()
    , "todo_comments"        = lintr::todo_comment_linter(c("todo", "fixme", "to-do"))
    , "trailing_blank"       = lintr::trailing_blank_lines_linter()
    , "trailing_white"       = lintr::trailing_whitespace_linter()
    , "true_false"           = lintr::T_and_F_symbol_linter()
    , "undesirable_function" = lintr::undesirable_function_linter(
        fun = c(
            "cbind" = paste0(
                "cbind is an unsafe way to build up a data frame. merge() or direct "
                , "column assignment is preferred."
            )
            , "dyn.load" = "Directly loading or unloading .dll or .so files in package code should not be necessary."
            , "dyn.unload" = "Directly loading or unloading .dll or .so files in package code should not be necessary."
            , "help" = interactive_text
            , "ifelse" = "The use of ifelse() is dangerous because it will silently allow mixing types."
            , "install.packages" = interactive_text
            , "is.list" = paste0(
                "This project uses data.table, and is.list(x) is TRUE for a data.table. "
                , "identical(class(x), 'list') is a safer way to check that something is an R list object."
            )
            , "rbind" = "data.table::rbindlist() is faster and safer than rbind(), and is preferred in this project."
            , "require" = paste0(
                "library() is preferred to require() because it will raise an error immediately "
                , "if a package is missing."
            )
        )
    )
    , "undesirable_operator" = lintr::undesirable_operator_linter(
        op = c(
            "%>%" = pipe_text
            , "%.%" = pipe_text
            , "%..%" = pipe_text
            , "|>" = pipe_text
            , "?" = interactive_text
            , "??" = interactive_text
        )
    )
    , "unnecessary_concatenation" = lintr::unnecessary_concatenation_linter()
    , "unnecessary_lambda"        = lintr::unnecessary_lambda_linter()
    , "unreachable_code"          = lintr::unreachable_code_linter()
    , "unused_import"             = lintr::unused_import_linter()
    , "vector_logic"              = lintr::vector_logic_linter()
    , "whitespace"                = lintr::whitespace_linter()
)

noquote(paste0(length(FILES_TO_LINT), " R files need linting"))

results <- NULL

for (r_file in FILES_TO_LINT) {

    this_result <- lintr::lint(
        filename = r_file
        , linters = LINTERS_TO_USE
        , cache = FALSE
    )

    print(
        sprintf(
            "Found %i linting errors in %s"
            , length(this_result)
            , r_file
        )
        , quote = FALSE
    )

    results <- c(results, this_result)

}

issues_found <- length(results)

noquote(paste0("Total linting issues found: ", issues_found))

if (issues_found > 0L) {
    print(results)
}

quit(save = "no", status = issues_found)


================================================
FILE: .ci/parameter-generator.py
================================================
# coding: utf-8
"""Helper script for generating config file and parameters list.

This script generates LightGBM/src/io/config_auto.cpp file
with list of all parameters, aliases table and other routines
along with parameters description in LightGBM/docs/Parameters.rst file
from the information in LightGBM/include/LightGBM/config.h file.
"""

import re
from collections import defaultdict
from pathlib import Path
from typing import Dict, List, Tuple


def get_parameter_infos(config_hpp: Path) -> Tuple[List[Tuple[str, int]], List[List[Dict[str, List]]]]:
    """Parse config header file.

    Parameters
    ----------
    config_hpp : pathlib.Path
        Path to the config header file.

    Returns
    -------
    infos : tuple
        Tuple with names and content of sections.
    """
    is_inparameter = False
    cur_key = None
    key_lvl = 0
    cur_info: Dict[str, List] = {}
    keys = []
    member_infos: List[List[Dict[str, List]]] = []
    with open(config_hpp) as config_hpp_file:
        for line in config_hpp_file:
            if line.strip() in {"#ifndef __NVCC__", "#endif  // __NVCC__"}:
                continue
            if "#pragma region Parameters" in line:
                is_inparameter = True
            elif "#pragma region" in line and "Parameters" in line:
                key_lvl += 1
                cur_key = line.split("region")[1].strip()
                keys.append((cur_key, key_lvl))
                member_infos.append([])
            elif "#pragma endregion" in line:
                key_lvl -= 1
                if cur_key is not None:
                    cur_key = None
                elif is_inparameter:
                    is_inparameter = False
            elif cur_key is not None:
                line = line.strip()
                if line.startswith("//"):
                    key, _, val = line[2:].partition("=")
                    key = key.strip()
                    val = val.strip()
                    if key not in cur_info:
                        if key == "descl2" and "desc" not in cur_info:
                            cur_info["desc"] = []
                        elif key != "descl2":
                            cur_info[key] = []
                    if key == "desc":
                        cur_info["desc"].append(("l1", val))
                    elif key == "descl2":
                        cur_info["desc"].append(("l2", val))
                    else:
                        cur_info[key].append(val)
                elif line:
                    has_eqsgn = False
                    tokens = line.split("=")
                    if len(tokens) == 2:
                        if "default" not in cur_info:
                            cur_info["default"] = [tokens[1][:-1].strip()]
                        has_eqsgn = True
                    tokens = line.split()
                    cur_info["inner_type"] = [tokens[0].strip()]
                    if "name" not in cur_info:
                        if has_eqsgn:
                            cur_info["name"] = [tokens[1].strip()]
                        else:
                            cur_info["name"] = [tokens[1][:-1].strip()]
                    member_infos[-1].append(cur_info)
                    cur_info = {}

    return keys, member_infos


def get_names(infos: List[List[Dict[str, List]]]) -> List[str]:
    """Get names of all parameters.

    Parameters
    ----------
    infos : list
        Content of the config header file.

    Returns
    -------
    names : list
        Names of all parameters.
    """
    names = []
    for x in infos:
        for y in x:
            names.append(y["name"][0])
    return names


def get_alias(infos: List[List[Dict[str, List]]]) -> List[Tuple[str, str]]:
    """Get aliases of all parameters.

    Parameters
    ----------
    infos : list
        Content of the config header file.

    Returns
    -------
    pairs : list
        List of tuples (param alias, param name).
    """
    pairs = []
    for x in infos:
        for y in x:
            if "alias" in y:
                name = y["name"][0]
                alias = y["alias"][0].split(",")
                for name2 in alias:
                    pairs.append((name2.strip(), name))
    return pairs


def parse_check(check: str, reverse: bool = False) -> Tuple[str, str]:
    """Parse the constraint.

    Parameters
    ----------
    check : str
        String representation of the constraint.
    reverse : bool, optional (default=False)
        Whether to reverse the sign of the constraint.

    Returns
    -------
    pair : tuple
        Parsed constraint in the form of tuple (value, sign).
    """
    try:
        idx = 1
        float(check[idx:])
    except ValueError:
        idx = 2
        float(check[idx:])
    if reverse:
        reversed_sign = {"<": ">", ">": "<", "<=": ">=", ">=": "<="}
        return check[idx:], reversed_sign[check[:idx]]
    else:
        return check[idx:], check[:idx]


def set_one_var_from_string(name: str, param_type: str, checks: List[str]) -> str:
    """Construct code for auto config file for one param value.

    Parameters
    ----------
    name : str
        Name of the parameter.
    param_type : str
        Type of the parameter.
    checks : list
        Constraints of the parameter.

    Returns
    -------
    ret : str
        Lines of auto config file with getting and checks of one parameter value.
    """
    ret = ""
    univar_mapper = {"int": "GetInt", "double": "GetDouble", "bool": "GetBool", "std::string": "GetString"}
    if "vector" not in param_type:
        ret += f'  {univar_mapper[param_type]}(params, "{name}", &{name});\n'
        if len(checks) > 0:
            check_mapper = {"<": "LT", ">": "GT", "<=": "LE", ">=": "GE"}
            for check in checks:
                value, sign = parse_check(check)
                ret += f"  CHECK_{check_mapper[sign]}({name}, {value});\n"
        ret += "\n"
    else:
        ret += f'  if (GetString(params, "{name}", &tmp_str)) {{\n'
        type2 = param_type.split("<")[1][:-1]
        if type2 == "std::string":
            ret += f"    {name} = Common::Split(tmp_str.c_str(), ',');\n"
        else:
            ret += f"    {name} = Common::StringToArray<{type2}>(tmp_str, ',');\n"
        ret += "  }\n\n"
    return ret


def gen_parameter_description(
    sections: List[Tuple[str, int]], descriptions: List[List[Dict[str, List]]], params_rst: Path
) -> None:
    """Write descriptions of parameters to the documentation file.

    Parameters
    ----------
    sections : list
        Names of parameters sections.
    descriptions : list
        Structured descriptions of parameters.
    params_rst : pathlib.Path
        Path to the file with parameters documentation.
    """
    params_to_write = []
    lvl_mapper = {1: "-", 2: "~"}
    for (section_name, section_lvl), section_params in zip(sections, descriptions):
        heading_sign = lvl_mapper[section_lvl]
        params_to_write.append(f"{section_name}\n{heading_sign * len(section_name)}")
        for param_desc in section_params:
            name = param_desc["name"][0]
            default_raw = param_desc["default"][0]
            default = default_raw.strip('"') if len(default_raw.strip('"')) > 0 else default_raw
            param_type = param_desc.get("type", param_desc["inner_type"])[0].split(":")[-1].split("<")[-1].strip(">")
            options = param_desc.get("options", [])
            if len(options) > 0:
                opts = "``, ``".join([x.strip() for x in options[0].split(",")])
                options_str = f", options: ``{opts}``"
            else:
                options_str = ""
            aliases = param_desc.get("alias", [])
            if len(aliases) > 0:
                aliases_joined = "``, ``".join([x.strip() for x in aliases[0].split(",")])
                aliases_str = f", aliases: ``{aliases_joined}``"
            else:
                aliases_str = ""
            checks = sorted(param_desc.get("check", []))
            checks_len = len(checks)
            if checks_len > 1:
                number1, sign1 = parse_check(checks[0])
                number2, sign2 = parse_check(checks[1], reverse=True)
                checks_str = f", constraints: ``{number2} {sign2} {name} {sign1} {number1}``"
            elif checks_len == 1:
                number, sign = parse_check(checks[0])
                checks_str = f", constraints: ``{name} {sign} {number}``"
            else:
                checks_str = ""
            main_desc = f'-  ``{name}`` :raw-html:`<a id="{name}" title="Permalink to this parameter" href="#{name}">&#x1F517;&#xFE0E;</a>`, default = ``{default}``, type = {param_type}{options_str}{aliases_str}{checks_str}'
            params_to_write.append(main_desc)
            params_to_write.extend([f"{' ' * 3 * int(desc[0][-1])}-  {desc[1]}" for desc in param_desc["desc"]])

    with open(params_rst) as original_params_file:
        all_lines = original_params_file.read()
        before, start_sep, _ = all_lines.partition(".. start params list\n\n")
        _, end_sep, after = all_lines.partition("\n\n.. end params list")

    with open(params_rst, "w") as new_params_file:
        new_params_file.write(before)
        new_params_file.write(start_sep)
        new_params_file.write("\n\n".join(params_to_write))
        new_params_file.write(end_sep)
        new_params_file.write(after)


def gen_parameter_code(
    config_hpp: Path, config_out_cpp: Path
) -> Tuple[List[Tuple[str, int]], List[List[Dict[str, List]]]]:
    """Generate auto config file.

    Parameters
    ----------
    config_hpp : pathlib.Path
        Path to the config header file.
    config_out_cpp : pathlib.Path
        Path to the auto config file.

    Returns
    -------
    infos : tuple
        Tuple with names and content of sections.
    """
    keys, infos = get_parameter_infos(config_hpp)
    names = get_names(infos)
    alias = get_alias(infos)
    names_with_aliases = defaultdict(list)
    str_to_write = r"""/*!
 * Copyright (c) 2018-2026 Microsoft Corporation. All rights reserved.
 * Copyright (c) 2018-2026 The LightGBM developers. All rights reserved.
 * Licensed under the MIT License. See LICENSE file in the project root for license information.
 *
 * \note
 * This file is auto generated by LightGBM\.ci\parameter-generator.py from LightGBM\include\LightGBM\config.h file.
 */
"""
    str_to_write += "#include <LightGBM/config.h>\n\n"
    str_to_write += "#include <string>\n"
    str_to_write += "#include <unordered_map>\n"
    str_to_write += "#include <unordered_set>\n"
    str_to_write += "#include <vector>\n\n"
    str_to_write += "namespace LightGBM {\n"

    # alias table
    str_to_write += "const std::unordered_map<std::string, std::string>& Config::alias_table() {\n"
    str_to_write += "  static std::unordered_map<std::string, std::string> aliases({\n"

    for pair in alias:
        str_to_write += f'  {{"{pair[0]}", "{pair[1]}"}},\n'
        names_with_aliases[pair[1]].append(pair[0])
    str_to_write += "  });\n"
    str_to_write += "  return aliases;\n"
    str_to_write += "}\n\n"

    # names
    str_to_write += "const std::unordered_set<std::string>& Config::parameter_set() {\n"
    str_to_write += "  static std::unordered_set<std::string> params({\n"

    for name in names:
        str_to_write += f'  "{name}",\n'
    str_to_write += "  });\n"
    str_to_write += "  return params;\n"
    str_to_write += "}\n\n"
    # from strings
    str_to_write += "void Config::GetMembersFromString(const std::unordered_map<std::string, std::string>& params) {\n"
    str_to_write += '  std::string tmp_str = "";\n'
    for x in infos:
        for y in x:
            if "[no-automatically-extract]" in y:
                continue
            param_type = y["inner_type"][0]
            name = y["name"][0]
            checks = []
            if "check" in y:
                checks = y["check"]
            tmp = set_one_var_from_string(name, param_type, checks)
            str_to_write += tmp
    # tails
    str_to_write = f"{str_to_write.strip()}\n}}\n\n"
    str_to_write += "std::string Config::SaveMembersToString() const {\n"
    str_to_write += "  std::stringstream str_buf;\n"
    for x in infos:
        for y in x:
            if "[no-save]" in y:
                continue
            param_type = y["inner_type"][0]
            name = y["name"][0]
            if "vector" in param_type:
                if "int8" in param_type:
                    str_to_write += f'  str_buf << "[{name}: " << Common::Join(Common::ArrayCast<int8_t, int>({name}), ",") << "]\\n";\n'
                else:
                    str_to_write += f'  str_buf << "[{name}: " << Common::Join({name}, ",") << "]\\n";\n'
            else:
                str_to_write += f'  str_buf << "[{name}: " << {name} << "]\\n";\n'
    # tails
    str_to_write += "  return str_buf.str();\n"
    str_to_write += "}\n\n"

    str_to_write += """const std::unordered_map<std::string, std::vector<std::string>>& Config::parameter2aliases() {
  static std::unordered_map<std::string, std::vector<std::string>> map({"""
    for name in names:
        str_to_write += '\n    {"' + name + '", '
        if names_with_aliases[name]:
            str_to_write += '{"' + '", "'.join(names_with_aliases[name]) + '"}},'
        else:
            str_to_write += "{}},"
    str_to_write += """
  });
  return map;
}

"""
    str_to_write += """const std::unordered_map<std::string, std::string>& Config::ParameterTypes() {
  static std::unordered_map<std::string, std::string> map({"""
    int_t_pat = re.compile(r"int\d+_t")
    # the following are stored as comma separated strings but are arrays in the wrappers
    overrides = {
        "categorical_feature": "vector<int>",
        "ignore_column": "vector<int>",
        "interaction_constraints": "vector<vector<int>>",
    }
    for x in infos:
        for y in x:
            name = y["name"][0]
            if name == "task":
                continue
            if name in overrides:
                param_type = overrides[name]
            else:
                param_type = int_t_pat.sub("int", y["inner_type"][0]).replace("std::", "")
            str_to_write += '\n    {"' + name + '", "' + param_type + '"},'
    str_to_write += """
  });
  return map;
}

"""

    str_to_write += "}  // namespace LightGBM\n"
    with open(config_out_cpp, "w") as config_out_cpp_file:
        config_out_cpp_file.write(str_to_write)

    return keys, infos


if __name__ == "__main__":
    current_dir = Path(__file__).absolute().parent
    config_hpp = current_dir.parent / "include" / "LightGBM" / "config.h"
    config_out_cpp = current_dir.parent / "src" / "io" / "config_auto.cpp"
    params_rst = current_dir.parent / "docs" / "Parameters.rst"
    sections, descriptions = gen_parameter_code(config_hpp, config_out_cpp)
    gen_parameter_description(sections, descriptions, params_rst)


================================================
FILE: .ci/pip-envs/requirements-latest.txt
================================================
# nightlies for: matplotlib, numpy, pandas, pyarrow, scipy, scikit-learn
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple

# runtime dependencies (using `.dev0` suffix to allow nightlies)
#
# pinning rules:
#
#   * latest versions of lightgbm's dependencies,
#   * including pre-releases and nightlies
#
cffi>=1.17.1
matplotlib>=3.11.0.dev0
numpy>=2.4.0.dev0
pandas>=3.0.0.dev0
pyarrow>=21.0.0.dev0
scikit-learn>=1.8.dev0
scipy>=1.17.0.dev0

# testing-only dependencies
cloudpickle>=3.1.1
psutil>=7.0
pytest>=8.4.1


================================================
FILE: .ci/pip-envs/requirements-oldest.txt
================================================
# oldest versions of dependencies published after
# minimum supported Python version's first release,
# for which there are wheels compatible with the
# python:{version} image
#
# see https://devguide.python.org/versions/
#
cffi==1.15.1
numpy==1.19.3
pandas==1.1.3
pyarrow==6.0.1
scikit-learn==0.24.2
scipy==1.6.0


================================================
FILE: .ci/rerun-workflow.sh
================================================
#!/bin/bash
#
# [description]
#     Rerun specified workflow for given pull request.
#
# [usage]
#     rerun-workflow.sh <WORKFLOW_ID> <PR_BRANCH>
#
# WORKFLOW_ID: Identifier (config name of ID) of a workflow to be rerun.
#
# PR_BRANCH: Name of pull request's branch.

set -e -E -u -o pipefail

if [ -z "$GITHUB_ACTIONS" ]; then
  echo "Must be run inside GitHub Actions CI"
  exit 1
fi

if [ $# -ne 2 ]; then
  echo "Usage: $0 <WORKFLOW_ID> <PR_BRANCH>"
  exit 1
fi

workflow_id=$1
pr_branch=$2

# --branch for some GitHub GLI commands does not respect the difference between forks and branches
# on the main repo. While some parts of the GitHub API refer to the branch of a workflow
# as '{org}:{branch}' for branches from forks, others expect only '{branch}'.
#
# This expansion trims a leading '{org}:' from 'pr_branch' if one is present.
pr_branch_no_fork_prefix="${pr_branch/*:/}"

RUN_ID=$(
  gh run list                              \
    --repo 'lightgbm-org/LightGBM'            \
    --workflow "${workflow_id}"            \
    --event "pull_request"                 \
    --branch "${pr_branch_no_fork_prefix}" \
    --json 'createdAt,databaseId'          \
    --jq 'sort_by(.createdAt) | reverse | .[0] | .databaseId'
)

if [[ -z "${RUN_ID}" ]]; then
  echo "ERROR: failed to find a run of workflow '${workflow_id}' for branch '${pr_branch}'"
  exit 1
fi

echo "Re-running workflow '${workflow_id}' (run ID ${RUN_ID})"

gh run rerun                  \
  --repo 'lightgbm-org/LightGBM' \
  "${RUN_ID}"


================================================
FILE: .ci/run-r-cmd-check.sh
================================================
#!/bin/bash

set -e -u -o pipefail

PKG_TARBALL="${1}"
declare -i ALLOWED_CHECK_NOTES=${2}

# 'R CMD check' redirects installation logs to a file, and returns
# a non-0 exit code if ERRORs are raised.
#
# The '||' here gives us an opportunity to echo out the installation
# logs prior to exiting the script.
check_succeeded="yes"
R CMD check "${PKG_TARBALL}" \
    --as-cran \
    --run-donttest \
|| check_succeeded="no"

CHECK_LOG_FILE=lightgbm.Rcheck/00check.log
BUILD_LOG_FILE=lightgbm.Rcheck/00install.out

echo "R CMD check build logs:"
cat "${BUILD_LOG_FILE}"

if [[ $check_succeeded == "no" ]]; then
    echo "R CMD check failed"
    exit 1
fi

# WARNINGs or ERRORs should be treated as a failure
if grep -q -E "WARNING|ERROR" "${CHECK_LOG_FILE}"; then
    echo "WARNINGs or ERRORs have been found by R CMD check"
    exit 1
fi

# Allow a configurable number of NOTEs.
# Sometimes NOTEs are raised in CI that wouldn't show up on an actual CRAN submission.
set +e
NUM_CHECK_NOTES=$(
    grep -o -E '[0-9]+ NOTE' "${CHECK_LOG_FILE}" \
    | sed 's/[^0-9]*//g'
)
if [[ ${NUM_CHECK_NOTES} -gt ${ALLOWED_CHECK_NOTES} ]]; then
    echo "Found ${NUM_CHECK_NOTES} NOTEs from R CMD check. Only ${ALLOWED_CHECK_NOTES} are allowed"
    exit 1
fi


================================================
FILE: .ci/set-commit-status.sh
================================================
#!/bin/bash
#
# [description]
#     Set a status with a given name to the specified commit.
#
# [usage]
#     set-commit-status.sh <NAME> <STATUS> <SHA>
#
# NAME: Name of status.
#       Status with existing name overwrites a previous one.
#
# STATUS: Status to be set.
#         Can be "error", "failure", "pending" or "success".
#
# SHA: SHA of a commit to set a status on.

set -e -E -u -o pipefail

if [ -z "$GITHUB_ACTIONS" ]; then
  echo "Must be run inside GitHub Actions CI"
  exit 1
fi

if [ $# -ne 3 ]; then
  echo "Usage: $0 <NAME> <STATUS> <SHA>"
  exit 1
fi

name=$1

status=$2
status=${status/error/failure}
status=${status/cancelled/failure}
status=${status/timed_out/failure}
status=${status/in_progress/pending}
status=${status/queued/pending}

sha=$3

data=$(
  jq -n \
    --arg state "${status}" \
    --arg url "${GITHUB_SERVER_URL}/lightgbm-org/LightGBM/actions/runs/${GITHUB_RUN_ID}" \
    --arg name "${name}" \
    '{"state":$state,"target_url":$url,"context":$name}'
)

curl -sL \
  --fail \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -d "$data" \
  "${GITHUB_API_URL}/repos/lightgbm-org/LightGBM/statuses/$sha"


================================================
FILE: .ci/setup.sh
================================================
#!/bin/bash

set -e -E -u -o pipefail

# defaults
IN_UBUNTU_BASE_CONTAINER=${IN_UBUNTU_BASE_CONTAINER:-"false"}
SETUP_CONDA=${SETUP_CONDA:-"true"}

ARCH=$(uname -m)


if [[ $OS_NAME == "macos" ]]; then
    # Check https://github.com/actions/runner-images/tree/main/images/macos for available
    # versions of Xcode
    macos_ver=$(sw_vers --productVersion)
    if [[ "${macos_ver}" =~ 15. ]]; then
        xcode_path="/Applications/Xcode_16.0.app/Contents/Developer"
    else
        xcode_path="/Applications/Xcode_15.0.app/Contents/Developer"
    fi
    sudo xcode-select -s "${xcode_path}" || exit 1
    if  [[ $COMPILER == "clang" ]]; then
        brew install libomp
    else  # gcc
        brew install 'gcc@14'
    fi
    if [[ $TASK == "mpi" ]]; then
        brew install open-mpi
    fi
    if [[ $TASK == "swig" ]]; then
        brew install swig
    fi
else  # Linux
    if type -f apt > /dev/null 2>&1; then
        sudo apt-get update
        sudo apt-get install --no-install-recommends -y \
            ca-certificates \
            curl
    else
        sudo yum update -y
        sudo yum install -y \
            ca-certificates \
            curl
    fi
    CMAKE_VERSION="3.30.0"
    curl -O -L \
        "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${ARCH}.sh" \
    || exit 1
    sudo mkdir /opt/cmake || exit 1
    sudo sh "cmake-${CMAKE_VERSION}-linux-${ARCH}.sh" --skip-license --prefix=/opt/cmake || exit 1
    sudo ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake || exit 1

    if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
        # fixes error "unable to initialize frontend: Dialog"
        # https://github.com/moby/moby/issues/27988#issuecomment-462809153
        echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections

        sudo apt-get update
        sudo apt-get install --no-install-recommends -y \
            software-properties-common

        sudo apt-get install --no-install-recommends -y \
            build-essential \
            git \
            libcurl4 \
            libicu-dev \
            libssl-dev \
            locales \
            locales-all || exit 1
        if [[ $COMPILER == "clang" ]]; then
            sudo apt-get install --no-install-recommends -y \
                clang \
                libomp-dev
        elif [[ $COMPILER == "clang-17" ]]; then
            sudo apt-get install --no-install-recommends -y \
                wget
            wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
            sudo apt-add-repository deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
            sudo apt-add-repository deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
            sudo apt-get update
            sudo apt-get install -y \
                clang-17 \
                libomp-17-dev
        fi

        export LANG="en_US.UTF-8"
        sudo update-locale LANG=${LANG}
        export LC_ALL="${LANG}"
    fi
    if [[ $TASK == "r-package" ]] && [[ $COMPILER == "clang" ]]; then
        sudo apt-get install --no-install-recommends -y \
            libomp-dev
    fi
    if [[ $TASK == "mpi" ]]; then
        if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
            sudo apt-get update
            sudo apt-get install --no-install-recommends -y \
                libopenmpi-dev \
                openmpi-bin
        else  # in manylinux image
            sudo yum update -y
            sudo yum install -y \
                openmpi-devel \
            || exit 1
        fi
    fi
    if [[ $TASK == "gpu" ]]; then
        if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
            sudo apt-get update
            sudo apt-get install --no-install-recommends -y \
                libboost1.74-dev \
                libboost-filesystem1.74-dev \
                ocl-icd-opencl-dev
        else  # in manylinux image
            sudo yum update -y
            sudo yum install -y \
                boost-devel \
                ocl-icd-devel \
                opencl-headers \
            || exit 1
        fi
    fi
    if [[ $TASK == "gpu" || $TASK == "bdist" ]]; then
        if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
            sudo apt-get update
            sudo apt-get install --no-install-recommends -y \
                patchelf \
                pocl-opencl-icd
        elif [[ $(uname -m) == "x86_64" ]]; then
            sudo yum update -y
            sudo yum install -y \
                ocl-icd-devel \
                opencl-headers \
            || exit 1
        fi
    fi
    if [[ $TASK == "cuda" ]]; then
        echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
        if [[ $COMPILER == "clang" ]]; then
            apt-get update
            apt-get install --no-install-recommends -y \
                clang \
                libomp-dev
        fi
    fi
fi

if [[ "${TASK}" != "cpp-tests" ]] && [[ "${TASK}" != "r-package" ]] && [[ "${TASK}" != "swig" ]]; then
    if [[ $SETUP_CONDA != "false" ]]; then
        curl \
            -sL \
            -o miniforge.sh \
            "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-${ARCH}.sh"
        sh miniforge.sh -b -p "${CONDA}"
    fi
    conda config --set always_yes yes --set changeps1 no
    conda update -q -y conda

    # print output of 'conda info', to help in submitting bug reports
    echo "conda info:"
    conda info
fi


================================================
FILE: .ci/test-python-latest.sh
================================================
#!/bin/bash

set -e -E -u -o pipefail

echo "installing lightgbm and its dependencies"
pip install \
    --prefer-binary \
    --upgrade \
    -r ./.ci/pip-envs/requirements-latest.txt \
    dist/*.whl

echo "installed package versions:"
pip freeze

echo ""
echo "running tests"
pytest tests/c_api_test/
pytest tests/python_package_test/


================================================
FILE: .ci/test-python-oldest.sh
================================================
#!/bin/bash

set -e -E -u -o pipefail

echo "installing lightgbm and its dependencies"
pip install \
    --prefer-binary \
    --upgrade \
    -r ./.ci/pip-envs/requirements-oldest.txt \
    dist/*.whl

echo "installed package versions:"
pip freeze

echo ""
echo "checking that examples run without error"

# run a few examples to test that Python-package minimally works
echo ""
echo "--- advanced_example.py ---"
echo ""
python ./examples/python-guide/advanced_example.py || exit 1

echo ""
echo "--- logistic_regression.py ---"
echo ""
python ./examples/python-guide/logistic_regression.py || exit 1

echo ""
echo "--- simple_example.py ---"
echo ""
python ./examples/python-guide/simple_example.py || exit 1

echo ""
echo "--- sklearn_example.py ---"
echo ""
python ./examples/python-guide/sklearn_example.py || exit 1

echo ""
echo "done testing on oldest supported Python version"


================================================
FILE: .ci/test-r-package-valgrind.sh
================================================
#!/bin/bash

set -e -E -u -o pipefail

RDscriptvalgrind ./.ci/install-r-deps.R --test || exit 1
sh build-cran-package.sh \
  --r-executable=RDvalgrind \
  --no-build-vignettes \
  || exit 1

RDvalgrind CMD INSTALL --preclean --install-tests lightgbm_*.tar.gz || exit 1

cd R-package/tests

ALL_LOGS_FILE="out.log"
VALGRIND_LOGS_FILE="valgrind-logs.log"

RDvalgrind \
  --no-readline \
  --vanilla \
  -d "valgrind --tool=memcheck --leak-check=full --track-origins=yes --gen-suppressions=all" \
  -f testthat.R \
  > ${ALL_LOGS_FILE} 2>&1 || exit 1

cat ${ALL_LOGS_FILE}

echo "writing valgrind output to ${VALGRIND_LOGS_FILE}"
cat ${ALL_LOGS_FILE} | grep -E "^\=" > ${VALGRIND_LOGS_FILE}

bytes_definitely_lost=$(
  cat ${VALGRIND_LOGS_FILE} \
      | grep -E "definitely lost\: .*" \
      | sed 's/^.*definitely lost\: \(.*\) bytes.*$/\1/' \
      | tr -d ","
)
echo "valgrind found ${bytes_definitely_lost} bytes definitely lost"
if [[ ${bytes_definitely_lost} -gt 0 ]]; then
    exit 1
fi

bytes_indirectly_lost=$(
    cat ${VALGRIND_LOGS_FILE} \
    | grep -E "indirectly lost\: .*" \
    | sed 's/^.*indirectly lost\: \(.*\) bytes.*$/\1/' \
    | tr -d ","
)
echo "valgrind found ${bytes_indirectly_lost} bytes indirectly lost"
if [[ ${bytes_indirectly_lost} -gt 0 ]]; then
    exit 1
fi

# one error caused by a false positive between valgrind and openmp is allowed
# ==2063== 352 bytes in 1 blocks are possibly lost in loss record 153 of 2,709
# ==2063==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
# ==2063==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
# ==2063==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
# ==2063==    by 0x5702322: allocate_stack (allocatestack.c:622)
# ==2063==    by 0x5702322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
# ==2063==    by 0x56D0DDA: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
# ==2063==    by 0x56C88E0: GOMP_parallel (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
# ==2063==    by 0x1544D29C: LGBM_DatasetCreateFromCSC (c_api.cpp:1286)
# ==2063==    by 0x1546F980: LGBM_DatasetCreateFromCSC_R (lightgbm_R.cpp:91)
# ==2063==    by 0x4941E2F: R_doDotCall (dotcode.c:634)
# ==2063==    by 0x494CCC6: do_dotcall (dotcode.c:1281)
# ==2063==    by 0x499FB01: bcEval (eval.c:7078)
# ==2063==    by 0x498B67F: Rf_eval (eval.c:727)
# ==2063==    by 0x498E414: R_execClosure (eval.c:1895)
bytes_possibly_lost=$(
    cat ${VALGRIND_LOGS_FILE} \
    | grep -E "possibly lost\: .*" \
    | sed 's/^.*possibly lost\: \(.*\) bytes.*$/\1/' \
    | tr -d ","
)
echo "valgrind found ${bytes_possibly_lost} bytes possibly lost"
if [[ ${bytes_possibly_lost} -gt 1104 ]]; then
    exit 1
fi

# ensure 'grep --count' doesn't cause failures
set +e

echo "checking for invalid reads"
invalid_reads=$(
  cat ${VALGRIND_LOGS_FILE} \
    | grep --count -i "Invalid read"
)
if [[ ${invalid_reads} -gt 0 ]]; then
    echo "valgrind found invalid reads: ${invalid_reads}"
    exit 1
fi

echo "checking for invalid writes"
invalid_writes=$(
  cat ${VALGRIND_LOGS_FILE} \
    | grep --count -i "Invalid write"
)
if [[ ${invalid_writes} -gt 0 ]]; then
    echo "valgrind found invalid writes: ${invalid_writes}"
    exit 1
fi


================================================
FILE: .ci/test-r-package-windows.ps1
================================================
# Download a file and retry upon failure. This looks like
# an infinite loop but CI-level timeouts will kill it
function Get-File-With-Tenacity {
    param(
        [Parameter(Mandatory = $true)][string]$url,
        [Parameter(Mandatory = $true)][string]$destfile
    )
    $ProgressPreference = "SilentlyContinue"  # progress bar bug extremely slows down download speed
    do {
        Write-Output "Downloading ${url}"
        sleep 5
        Invoke-WebRequest -Uri $url -OutFile $destfile
    } while (-not $?)
}

# External utilities like R.exe / Rscript.exe writing to stderr (even for harmless
# status information) can cause failures in GitHub Actions PowerShell jobs.
# See https://github.community/t/powershell-steps-fail-nondeterministically/115496
#
# Using standard PowerShell redirection does not work to avoid these errors.
# This function uses R's built-in redirection mechanism, sink(). Any place where
# this function is used is a command that writes harmless messages to stderr
function Invoke-R-Code-Redirect-Stderr {
    param(
        [Parameter(Mandatory = $true)][string]$rcode
    )
    $decorated_code = "out_file <- file(tempfile(), open = 'wt'); sink(out_file, type = 'message'); $rcode; sink()"
    Rscript --vanilla -e $decorated_code
}

# Remove all items matching some pattern from PATH environment variable
function Remove-From-Path {
    [CmdletBinding(SupportsShouldProcess)]
    param(
        [Parameter(Mandatory = $true)][string]$pattern_to_remove
    )
    if ($PSCmdlet.ShouldProcess($env:PATH, "Removing ${pattern_to_remove}")) {
        $env:PATH = ($env:PATH.Split(';') | Where-Object { $_ -notmatch "$pattern_to_remove" }) -join ';'
    }
}

# remove some details that exist in the GitHub Actions images which might
# cause conflicts with R and other components installed by this script
$env:RTOOLS40_HOME = ""
Remove-From-Path ".*Amazon.*"
Remove-From-Path ".*Anaconda.*"
Remove-From-Path ".*android.*"
Remove-From-Path ".*Android.*"
Remove-From-Path ".*chocolatey.*"
Remove-From-Path ".*Chocolatey.*"
Remove-From-Path ".*cmake.*"
Remove-From-Path ".*CMake.*"
Remove-From-Path ".*\\Git\\.*"
Remove-From-Path "(?!.*pandoc.*).*hostedtoolcache.*"
Remove-From-Path ".*Microsoft SDKs.*"
Remove-From-Path ".*mingw.*"
Remove-From-Path ".*msys64.*"
Remove-From-Path ".*PostgreSQL.*"
Remove-From-Path ".*\\R\\.*"
Remove-From-Path ".*R Client.*"
Remove-From-Path ".*rtools40.*"
Remove-From-Path ".*rtools42.*"
Remove-From-Path ".*rtools43.*"
Remove-From-Path ".*rtools44.*"
Remove-From-Path ".*rtools45.*"
Remove-From-Path ".*shells.*"
Remove-From-Path ".*Strawberry.*"
Remove-From-Path ".*tools.*"

Remove-Item C:\rtools40 -Force -Recurse -ErrorAction Ignore
Remove-Item C:\rtools42 -Force -Recurse -ErrorAction Ignore
Remove-Item C:\rtools43 -Force -Recurse -ErrorAction Ignore
Remove-Item C:\rtools44 -Force -Recurse -ErrorAction Ignore
Remove-Item C:\rtools45 -Force -Recurse -ErrorAction Ignore

# Get details needed for installing R components
#
# NOTES:
#    * some paths and file names are different on R4.0
$env:R_MAJOR_VERSION = $env:R_VERSION.split('.')[0]
if ($env:R_MAJOR_VERSION -eq "4") {
    $RTOOLS_INSTALL_PATH = "C:\rtools43"
    $env:RTOOLS_BIN = "$RTOOLS_INSTALL_PATH\usr\bin"
    $env:RTOOLS_MINGW_BIN = "$RTOOLS_INSTALL_PATH\x86_64-w64-mingw32.static.posix\bin"
    $env:RTOOLS_EXE_FILE = "rtools43-5550-5548.exe"
    $env:R_WINDOWS_VERSION = "4.3.1"
} else {
    Write-Output "[ERROR] Unrecognized R version: $env:R_VERSION"
    Assert-Output $false
}
$env:CMAKE_VERSION = "3.30.0"

$env:R_LIB_PATH = "$env:BUILD_SOURCESDIRECTORY/RLibrary" -replace '[\\]', '/'
$env:R_LIBS = "$env:R_LIB_PATH"
$env:CMAKE_PATH = "$env:BUILD_SOURCESDIRECTORY/CMake_installation"
$env:PATH = @(
    "$env:RTOOLS_BIN",
    "$env:RTOOLS_MINGW_BIN",
    "$env:R_LIB_PATH/R/bin/x64",
    "$env:CMAKE_PATH/cmake-$env:CMAKE_VERSION-windows-x86_64/bin",
    "$env:PATH"
) -join ";"
$env:CRAN_MIRROR = "https://cran.rstudio.com"
$env:MIKTEX_EXCEPTION_PATH = "$env:TEMP\miktex"

# don't fail builds for long-running examples unless they're very long.
# See https://github.com/lightgbm-org/LightGBM/issues/4049#issuecomment-793412254.
if ($env:R_BUILD_TYPE -ne "cran") {
    $env:_R_CHECK_EXAMPLE_TIMING_THRESHOLD_ = 30
}

if (($env:COMPILER -eq "MINGW") -and ($env:R_BUILD_TYPE -eq "cmake")) {
    $env:CXX = "$env:RTOOLS_MINGW_BIN/g++.exe"
    $env:CC = "$env:RTOOLS_MINGW_BIN/gcc.exe"
}

Set-Location "$env:BUILD_SOURCESDIRECTORY"
tzutil /s "GMT Standard Time"
[Void][System.IO.Directory]::CreateDirectory("$env:R_LIB_PATH")
[Void][System.IO.Directory]::CreateDirectory("$env:CMAKE_PATH")

# download R, RTools and CMake
Write-Output "Downloading R, Rtools and CMake"
$params = @{
    url = "$env:CRAN_MIRROR/bin/windows/base/old/$env:R_WINDOWS_VERSION/R-$env:R_WINDOWS_VERSION-win.exe"
    destfile = "R-win.exe"
}
Get-File-With-Tenacity @params

$params = @{
    url = "https://github.com/lightgbm-org/LightGBM/releases/download/v2.0.12/$env:RTOOLS_EXE_FILE"
    destfile = "Rtools.exe"
}
Get-File-With-Tenacity @params

$params = @{
    url = "https://github.com/Kitware/CMake/releases/download/v{0}/cmake-{0}-windows-x86_64.zip" -f $env:CMAKE_VERSION
    destfile = "$env:CMAKE_PATH/cmake.zip"
}
Get-File-With-Tenacity @params

# Install R
Write-Output "Installing R"
$params = @{
    FilePath = "R-win.exe"
    NoNewWindow = $true
    Wait = $true
    ArgumentList = "/VERYSILENT /DIR=$env:R_LIB_PATH/R /COMPONENTS=main,x64,i386"
}
Start-Process @params ; Assert-Output $?
Write-Output "Done installing R"

Write-Output "Installing Rtools"
$params = @{
    FilePath = "Rtools.exe"
    NoNewWindow = $true
    Wait = $true
    ArgumentList = "/VERYSILENT /SUPPRESSMSGBOXES /DIR=$RTOOLS_INSTALL_PATH"
}
Start-Process @params; Assert-Output $?
Write-Output "Done installing Rtools"

Write-Output "Installing CMake"
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:CMAKE_PATH/cmake.zip", "$env:CMAKE_PATH") ; Assert-Output $?
# Remove old CMake shipped with RTools
Remove-Item "$env:RTOOLS_MINGW_BIN/cmake.exe" -Force -ErrorAction Ignore
Write-Output "Done installing CMake"

Write-Output "Installing dependencies"
Rscript.exe --vanilla ".ci/install-r-deps.R" --build --include=processx --test ; Assert-Output $?

Write-Output "Building R-package"

# R CMD check is not used for MSVC builds
if ($env:COMPILER -ne "MSVC") {

    $PKG_FILE_NAME = "lightgbm_$env:LGB_VER.tar.gz"
    $LOG_FILE_NAME = "lightgbm.Rcheck/00check.log"

    if ($env:R_BUILD_TYPE -eq "cmake") {
        if ($env:TOOLCHAIN -eq "MINGW") {
            Write-Output "Telling R to use MinGW"
            $env:BUILD_R_FLAGS = "c('--skip-install', '--use-mingw', '-j4')"
        } elseif ($env:TOOLCHAIN -eq "MSYS") {
            Write-Output "Telling R to use MSYS"
            $env:BUILD_R_FLAGS = "c('--skip-install', '--use-msys2', '-j4')"
        } elseif ($env:TOOLCHAIN -eq "MSVC") {
            $env:BUILD_R_FLAGS = "'--skip-install'"
        } else {
            Write-Output "[ERROR] Unrecognized toolchain: $env:TOOLCHAIN"
            Assert-Output $false
        }
        Invoke-R-Code-Redirect-Stderr "commandArgs <- function(...){$env:BUILD_R_FLAGS}; source('build_r.R')"
        Assert-Output $?
    } elseif ($env:R_BUILD_TYPE -eq "cran") {
        $params = -join @(
            "result <- processx::run(command = 'sh', args = 'build-cran-package.sh', ",
            "echo = TRUE, windows_verbatim_args = FALSE, error_on_status = TRUE)"
        )
        Invoke-R-Code-Redirect-Stderr $params ; Assert-Output $?
        Remove-From-Path ".*msys64.*"
        # Test CRAN source .tar.gz in a directory that is not this repo or below it.
        # When people install.packages('lightgbm'), they won't have the LightGBM
        # git repo around. This is to protect against the use of relative paths
        # like ../../CMakeLists.txt that would only work if you are in the repoo
        $R_CMD_CHECK_DIR = "tmp-r-cmd-check"
        New-Item -Path "C:\" -Name $R_CMD_CHECK_DIR -ItemType "directory" > $null
        Move-Item -Path "$PKG_FILE_NAME" -Destination "C:\$R_CMD_CHECK_DIR\" > $null
        Set-Location "C:\$R_CMD_CHECK_DIR\"
    }

    Write-Output "Running R CMD check"
    if ($env:R_BUILD_TYPE -eq "cran") {
        # CRAN packages must pass without --no-multiarch (build on 64-bit and 32-bit)
        $check_args = "c('CMD', 'check', '--as-cran', '--run-donttest', '$PKG_FILE_NAME')"
    } else {
        $check_args = "c('CMD', 'check', '--no-multiarch', '--as-cran', '--run-donttest', '$PKG_FILE_NAME')"
    }
    $params = -join (
        "result <- processx::run(command = 'R.exe', args = $check_args, ",
        "echo = TRUE, windows_verbatim_args = FALSE, error_on_status = TRUE)"
    )
    Invoke-R-Code-Redirect-Stderr $params ; $check_succeeded = $?

    Write-Output "R CMD check build logs:"
    $INSTALL_LOG_FILE_NAME = "lightgbm.Rcheck\00install.out"
    Get-Content -Path "$INSTALL_LOG_FILE_NAME"

    Assert-Output $check_succeeded

    Write-Output "Looking for issues with R CMD check results"
    if (Get-Content "$LOG_FILE_NAME" | Select-String -Pattern "NOTE|WARNING|ERROR" -CaseSensitive -Quiet) {
        Write-Output "NOTEs, WARNINGs, or ERRORs have been found by R CMD check"
        Assert-Output $False
    }
} else {
    $INSTALL_LOG_FILE_NAME = "$env:BUILD_SOURCESDIRECTORY\00install_out.txt"
    Invoke-R-Code-Redirect-Stderr "source('build_r.R')" 1> $INSTALL_LOG_FILE_NAME ; $install_succeeded = $?
    Write-Output "----- build and install logs -----"
    Get-Content -Path "$INSTALL_LOG_FILE_NAME"
    Write-Output "----- end of build and install logs -----"
    Assert-Output $install_succeeded
    # some errors are not raised above, but can be found in the logs
    if (Get-Content "$INSTALL_LOG_FILE_NAME" | Select-String -Pattern "ERROR" -CaseSensitive -Quiet) {
        Write-Output "ERRORs have been found installing lightgbm"
        Assert-Output $False
    }
}

# Checking that the correct R version was used
if ($env:TOOLCHAIN -ne "MSVC") {
    $checks = Select-String -Path "${LOG_FILE_NAME}" -Pattern "using R version $env:R_WINDOWS_VERSION"
    $checks_cnt = $checks.Matches.length
} else {
    $checksParams = @{
        Path = "${INSTALL_LOG_FILE_NAME}"
        Pattern = "R version passed into FindLibR.* $env:R_WINDOWS_VERSION"
    }
    $checks = Select-String @checksParams
    $checks_cnt = $checks.Matches.length
}
if ($checks_cnt -eq 0) {
    Write-Output "Wrong R version was found (expected '$env:R_WINDOWS_VERSION'). Check the build logs."
    Assert-Output $False
}

# Checking that we actually got the expected compiler. The R-package has some logic
# to fail back to MinGW if MSVC fails, but for CI builds we need to check that the correct
# compiler was used.
if ($env:R_BUILD_TYPE -eq "cmake") {
    $checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern "Check for working CXX compiler.*$env:COMPILER"
    if ($checks.Matches.length -eq 0) {
        Write-Output "The wrong compiler was used. Check the build logs."
        Assert-Output $False
    }
}

# Checking that we got the right toolchain for MinGW. If using MinGW, both
# MinGW and MSYS toolchains are supported
if (($env:COMPILER -eq "MINGW") -and ($env:R_BUILD_TYPE -eq "cmake")) {
    $checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern "Trying to build with.*$env:TOOLCHAIN"
    if ($checks.Matches.length -eq 0) {
        Write-Output "The wrong toolchain was used. Check the build logs."
        Assert-Output $False
    }
}

# Checking that MM_PREFETCH preprocessor definition is actually used in CI builds.
if ($env:R_BUILD_TYPE -eq "cran") {
    $checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern "checking whether MM_PREFETCH work.*yes"
    $checks_cnt = $checks.Matches.length
} elseif ($env:TOOLCHAIN -ne "MSVC") {
    $checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern ".*Performing Test MM_PREFETCH - Success"
    $checks_cnt = $checks.Matches.length
} else {
    $checks_cnt = 1
}
if ($checks_cnt -eq 0) {
    Write-Output "MM_PREFETCH preprocessor definition wasn't used. Check the build logs."
    Assert-Output $False
}

# Checking that MM_MALLOC preprocessor definition is actually used in CI builds.
if ($env:R_BUILD_TYPE -eq "cran") {
    $checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern "checking whether MM_MALLOC work.*yes"
    $checks_cnt = $checks.Matches.length
} elseif ($env:TOOLCHAIN -ne "MSVC") {
    $checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern ".*Performing Test MM_MALLOC - Success"
    $checks_cnt = $checks.Matches.length
} else {
    $checks_cnt = 1
}
if ($checks_cnt -eq 0) {
    Write-Output "MM_MALLOC preprocessor definition wasn't used. Check the build logs."
    Assert-Output $False
}

# Checking that OpenMP is actually used in CMake builds.
if ($env:R_BUILD_TYPE -eq "cmake") {
    $checks = Select-String -Path "${INSTALL_LOG_FILE_NAME}" -Pattern ".*Found OpenMP: TRUE.*"
    if ($checks.Matches.length -eq 0) {
        Write-Output "OpenMP wasn't found. Check the build logs."
        Assert-Output $False
    }
}

if ($env:COMPILER -eq "MSVC") {
    Write-Output "Running tests with testthat.R"
    Set-Location R-package/tests
    # NOTE: using Rscript.exe intentionally here, instead of Invoke-R-Code-Redirect-Stderr,
    #       because something about the interaction between Invoke-R-Code-Redirect-Stderr
    #       and testthat results in failing tests not exiting with a non-0 exit code.
    Rscript.exe --vanilla "testthat.R" ; Assert-Output $?
}

Write-Output "No issues were found checking the R-package"


================================================
FILE: .ci/test-r-package.sh
================================================
#!/bin/bash

set -e -E -u -o pipefail

# defaults
ARCH=$(uname -m)

# set up R environment
export CRAN_MIRROR="https://cran.rstudio.com"
export R_LIB_PATH=~/Rlib
mkdir -p $R_LIB_PATH
export R_LIBS=$R_LIB_PATH
export PATH="$R_LIB_PATH/R/bin:$PATH"

# don't fail builds for long-running examples unless they're very long.
# See https://github.com/lightgbm-org/LightGBM/issues/4049#issuecomment-793412254.
if [[ $R_BUILD_TYPE != "cran" ]]; then
    export _R_CHECK_EXAMPLE_TIMING_THRESHOLD_=30
fi

# Get details needed for installing R components
R_MAJOR_VERSION="${R_VERSION%.*}"
if [[ "${R_MAJOR_VERSION}" == "4" ]]; then
    export R_MAC_VERSION=4.3.1
    export R_MAC_PKG_URL=${CRAN_MIRROR}/bin/macosx/big-sur-${ARCH}/base/R-${R_MAC_VERSION}-${ARCH}.pkg
    export R_LINUX_VERSION="4.3.1-1.2204.0"
    export R_APT_REPO="jammy-cran40/"
else
    echo "Unrecognized R version: ${R_VERSION}"
    exit 1
fi

# installing precompiled R for Ubuntu
# https://cran.r-project.org/bin/linux/ubuntu/#installation
# adding steps from https://stackoverflow.com/a/56378217/3986677 to get latest version
#
# `devscripts` is required for 'checkbashisms' (https://github.com/r-lib/actions/issues/111)
if [[ $OS_NAME == "linux" ]]; then
    mkdir -p ~/.gnupg
    echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf
    sudo apt-key adv \
        --homedir ~/.gnupg \
        --keyserver keyserver.ubuntu.com \
        --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 || exit 1
    sudo add-apt-repository \
        "deb ${CRAN_MIRROR}/bin/linux/ubuntu ${R_APT_REPO}" || exit 1
    sudo apt-get update
    sudo apt-get install \
        --no-install-recommends \
        -y \
            devscripts \
            r-base-core=${R_LINUX_VERSION} \
            r-base-dev=${R_LINUX_VERSION} \
            texinfo \
            texlive-latex-extra \
            texlive-latex-recommended \
            texlive-fonts-recommended \
            texlive-fonts-extra \
            tidy \
            qpdf \
            || exit 1

    if [[ $R_BUILD_TYPE == "cran" ]]; then
        sudo apt-get install \
            --no-install-recommends \
            -y \
                "autoconf=$(cat R-package/AUTOCONF_UBUNTU_VERSION)" \
                automake \
                || exit 1
    fi
fi

# Installing R precompiled for Mac OS 10.11 or higher
if [[ $OS_NAME == "macos" ]]; then
    brew update-reset --auto-update
    brew update --auto-update
    if [[ $R_BUILD_TYPE == "cran" ]]; then
        brew install automake || exit 1
    fi
    brew install \
        checkbashisms \
        qpdf || exit 1
    brew install basictex || exit 1
    export PATH="/Library/TeX/texbin:$PATH"
    sudo tlmgr --verify-repo=none update --self || exit 1
    sudo tlmgr --verify-repo=none install inconsolata helvetic rsfs || exit 1

    curl -sL "${R_MAC_PKG_URL}" -o R.pkg || exit 1
    sudo installer \
        -pkg "$(pwd)/R.pkg" \
        -target / || exit 1

    # install tidy v5.8.0
    # ref: https://groups.google.com/g/r-sig-mac/c/7u_ivEj4zhM
    TIDY_URL=https://github.com/htacg/tidy-html5/releases/download/5.8.0/tidy-5.8.0-macos-x86_64+arm64.pkg
    curl -sL ${TIDY_URL} -o tidy.pkg
    sudo installer \
        -pkg "$(pwd)/tidy.pkg" \
        -target /

    # ensure that this newer version of 'tidy' is used by 'R CMD check'
    # ref: https://cran.r-project.org/doc/manuals/R-exts.html#Checking-packages
    export R_TIDYCMD=/usr/local/bin/tidy
fi

# {Matrix} needs {lattice}, so this needs to run before manually installing {Matrix}.
# This should be unnecessary on R >=4.4.0
# ref: https://github.com/lightgbm-org/LightGBM/issues/6433
Rscript --vanilla -e "install.packages('lattice', repos = '${CRAN_MIRROR}', lib = '${R_LIB_PATH}')"

# manually install {Matrix}, as {Matrix}=1.7-0 raised its R floor all the way to R 4.4.0
# ref: https://github.com/lightgbm-org/LightGBM/issues/6433
Rscript --vanilla -e "install.packages('https://cran.r-project.org/src/contrib/Archive/Matrix/Matrix_1.6-5.tar.gz', repos = NULL, lib = '${R_LIB_PATH}')"

# Manually install dependencies to avoid a CI-time dependency on devtools (for devtools::install_deps())
Rscript --vanilla ./.ci/install-r-deps.R --build --test --exclude=Matrix || exit 1

cd "${BUILD_DIRECTORY}"
PKG_TARBALL="lightgbm_$(head -1 VERSION.txt).tar.gz"
BUILD_LOG_FILE="lightgbm.Rcheck/00install.out"
LOG_FILE_NAME="lightgbm.Rcheck/00check.log"
if [[ $R_BUILD_TYPE == "cmake" ]]; then
    Rscript build_r.R -j4 --skip-install || exit 1
elif [[ $R_BUILD_TYPE == "cran" ]]; then

    # on Linux, we recreate configure in CI to test if
    # a change in a PR has changed configure.ac
    if [[ $OS_NAME == "linux" ]]; then
        ./R-package/recreate-configure.sh

        num_files_changed=$(
            git diff --name-only | wc -l
        )
        if [[ ${num_files_changed} -gt 0 ]]; then
            echo "'configure' in the R-package has changed. Please recreate it and commit the changes."
            echo "Changed files:"
            git diff --compact-summary
            echo "See R-package/README.md for details on how to recreate this script."
            echo ""
            exit 1
        fi
    fi

    ./build-cran-package.sh || exit 1

    # Test CRAN source .tar.gz in a directory that is not this repo or below it.
    # When people install.packages('lightgbm'), they won't have the LightGBM
    # git repo around. This is to protect against the use of relative paths
    # like ../../CMakeLists.txt that would only work if you are in the repo
    R_CMD_CHECK_DIR="${HOME}/tmp-r-cmd-check/"
    mkdir -p "${R_CMD_CHECK_DIR}"
    mv "${PKG_TARBALL}" "${R_CMD_CHECK_DIR}"
    cd "${R_CMD_CHECK_DIR}"
fi

if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
    cp "${PKG_TARBALL}" "${BUILD_ARTIFACTSTAGINGDIRECTORY}/lightgbm-${LGB_VER}-r-cran.tar.gz"
fi

declare -i allowed_notes=0
bash "${BUILD_DIRECTORY}/.ci/run-r-cmd-check.sh" \
    "${PKG_TARBALL}" \
    "${allowed_notes}"

# ensure 'grep --count' doesn't cause failures
set +e

used_correct_r_version=$(
    cat $LOG_FILE_NAME \
    | grep --count "using R version ${R_VERSION}"
)
if [[ $used_correct_r_version -ne 1 ]]; then
    echo "Unexpected R version was used. Expected '${R_VERSION}'."
    exit 1
fi

if [[ $R_BUILD_TYPE == "cmake" ]]; then
    passed_correct_r_version_to_cmake=$(
        cat $BUILD_LOG_FILE \
        | grep --count "R version passed into FindLibR.cmake: ${R_VERSION}"
    )
    if [[ $passed_correct_r_version_to_cmake -ne 1 ]]; then
        echo "Unexpected R version was passed into cmake. Expected '${R_VERSION}'."
        exit 1
    fi
fi

# this check makes sure that CI builds of the package actually use OpenMP
if [[ $OS_NAME == "macos" ]] && [[ $R_BUILD_TYPE == "cran" ]]; then
    omp_working=$(
        cat $BUILD_LOG_FILE \
        | grep --count -E "checking whether OpenMP will work .*yes"
    )
elif [[ $R_BUILD_TYPE == "cmake" ]]; then
    omp_working=$(
        cat $BUILD_LOG_FILE \
        | grep --count -E ".*Found OpenMP: TRUE.*"
    )
else
    omp_working=1
fi
if [[ $omp_working -ne 1 ]]; then
    echo "OpenMP was not found"
    exit 1
fi

# this check makes sure that CI builds of the package
# actually use MM_PREFETCH preprocessor definition
#
# _mm_prefetch will not work on arm64 architecture
# ref: https://github.com/lightgbm-org/LightGBM/issues/4124
if [[ $ARCH != "arm64" ]]; then
    if [[ $R_BUILD_TYPE == "cran" ]]; then
        mm_prefetch_working=$(
            cat $BUILD_LOG_FILE \
            | grep --count -E "checking whether MM_PREFETCH work.*yes"
        )
    else
        mm_prefetch_working=$(
            cat $BUILD_LOG_FILE \
            | grep --count -E ".*Performing Test MM_PREFETCH - Success"
        )
    fi
    if [[ $mm_prefetch_working -ne 1 ]]; then
        echo "MM_PREFETCH test was not passed"
        exit 1
    fi
fi

# this check makes sure that CI builds of the package
# actually use MM_MALLOC preprocessor definition
if [[ $R_BUILD_TYPE == "cran" ]]; then
    mm_malloc_working=$(
        cat $BUILD_LOG_FILE \
        | grep --count -E "checking whether MM_MALLOC work.*yes"
    )
else
    mm_malloc_working=$(
        cat $BUILD_LOG_FILE \
        | grep --count -E ".*Performing Test MM_MALLOC - Success"
    )
fi
if [[ $mm_malloc_working -ne 1 ]]; then
    echo "MM_MALLOC test was not passed"
    exit 1
fi

# this check makes sure that no "warning: unknown pragma ignored" logs
# reach the user leading them to believe that something went wrong
if [[ $R_BUILD_TYPE == "cran" ]]; then
    pragma_warning_present=$(
        cat $BUILD_LOG_FILE \
        | grep --count -E "warning: unknown pragma ignored"
    )
    if [[ $pragma_warning_present -ne 0 ]]; then
        echo "Unknown pragma warning is present, pragmas should have been removed before build"
        exit 1
    fi
fi


================================================
FILE: .ci/test-windows.ps1
================================================
function Assert-Output {
    param( [Parameter(Mandatory = $true)][bool]$success )
    if (-not $success) {
        $host.SetShouldExit(-1)
        exit 1
    }
}

$env:CONDA_ENV = "test-env"
$env:LGB_VER = (Get-Content $env:BUILD_SOURCESDIRECTORY\VERSION.txt).trim()
# Use custom temp directory to avoid
# > warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory
# > as it could lead to issues with incremental build.
# And make sure this directory is always clean
$env:TMPDIR = "$env:USERPROFILE\tmp"
Remove-Item $env:TMPDIR -Force -Recurse -ErrorAction Ignore
[Void][System.IO.Directory]::CreateDirectory($env:TMPDIR)

# create the artifact upload directory if it doesn't exist yet
[Void][System.IO.Directory]::CreateDirectory($env:BUILD_ARTIFACTSTAGINGDIRECTORY)

if ($env:TASK -eq "r-package") {
    & .\.ci\test-r-package-windows.ps1 ; Assert-Output $?
    exit 0
}

if ($env:TASK -eq "cpp-tests") {
    cmake -B build -S . -DBUILD_CPP_TEST=ON -DUSE_DEBUG=ON -A x64
    cmake --build build --target testlightgbm --config Debug ; Assert-Output $?
    .\Debug\testlightgbm.exe ; Assert-Output $?
    exit 0
}

if ($env:TASK -eq "swig") {
    $env:JAVA_HOME = $env:JAVA_HOME_8_X64  # there is pre-installed Eclipse Temurin 8 somewhere
    $ProgressPreference = "SilentlyContinue"  # progress bar bug extremely slows down download speed
    $params = @{
        Uri = "https://sourceforge.net/projects/swig/files/latest/download"
        OutFile = "$env:BUILD_SOURCESDIRECTORY/swig/swigwin.zip"
        UserAgent = "curl"
    }
    Invoke-WebRequest @params
    Add-Type -AssemblyName System.IO.Compression.FileSystem
    [System.IO.Compression.ZipFile]::ExtractToDirectory(
        "$env:BUILD_SOURCESDIRECTORY/swig/swigwin.zip",
        "$env:BUILD_SOURCESDIRECTORY/swig"
    ) ; Assert-Output $?
    $SwigFolder = Get-ChildItem -Name -Path "$env:BUILD_SOURCESDIRECTORY/swig" -Attributes Directory
    $env:PATH = @("$env:BUILD_SOURCESDIRECTORY/swig/$SwigFolder", "$env:PATH") -join ";"
    $BuildLogFileName = "$env:BUILD_SOURCESDIRECTORY\cmake_build.log"
    cmake -B build -S . -A x64 -DUSE_SWIG=ON *> "$BuildLogFileName" ; $build_succeeded = $?
    Write-Output "CMake build logs:"
    Get-Content -Path "$BuildLogFileName"
    Assert-Output $build_succeeded
    $checks = Select-String -Path "${BuildLogFileName}" -Pattern "-- Found SWIG.*${SwigFolder}/swig.exe"
    $checks_cnt = $checks.Matches.length
    if ($checks_cnt -eq 0) {
        Write-Output "Wrong SWIG version was found (expected '${SwigFolder}'). Check the build logs."
        Assert-Output $False
    }
    cmake --build build --target ALL_BUILD --config Release ; Assert-Output $?
    if ($env:PRODUCES_ARTIFACTS -eq "true") {
        cp ./build/lightgbmlib.jar $env:BUILD_ARTIFACTSTAGINGDIRECTORY/lightgbmlib_win.jar ; Assert-Output $?
    }
    exit 0
}

# setup for Python
conda activate ; Assert-Output $?
conda config --set always_yes yes --set changeps1 no ; Assert-Output $?
conda config --remove channels defaults ; Assert-Output $?
conda config --add channels nodefaults ; Assert-Output $?
conda config --add channels conda-forge ; Assert-Output $?
conda config --set channel_priority strict ; Assert-Output $?
conda install -q -y conda "python=$env:PYTHON_VERSION[build=*_cp*]" ; Assert-Output $?

# print output of 'conda info', to help in submitting bug reports
Write-Output "conda info:"
conda info

if ($env:PYTHON_VERSION -eq "3.9") {
    $env:CONDA_REQUIREMENT_FILE = "$env:BUILD_SOURCESDIRECTORY/.ci/conda-envs/ci-core-py39.txt"
} else {
    $env:CONDA_REQUIREMENT_FILE = "$env:BUILD_SOURCESDIRECTORY/.ci/conda-envs/ci-core.txt"
}

$condaParams = @(
    "-y",
    "-n", "$env:CONDA_ENV",
    "--file", "$env:CONDA_REQUIREMENT_FILE",
    "python=$env:PYTHON_VERSION[build=*_cp*]"
)
conda create @condaParams ; Assert-Output $?

# print output of 'conda list', to help in submitting bug reports
Write-Output "conda list:"
conda list -n $env:CONDA_ENV

if ($env:TASK -ne "bdist") {
    conda activate $env:CONDA_ENV
}

Set-Location "$env:BUILD_SOURCESDIRECTORY"
if ($env:TASK -eq "regular") {
    cmake -B build -S . -A x64 ; Assert-Output $?
    cmake --build build --target ALL_BUILD --config Release ; Assert-Output $?
    sh ./build-python.sh install --precompile ; Assert-Output $?
    cp ./Release/lib_lightgbm.dll "$env:BUILD_ARTIFACTSTAGINGDIRECTORY"
    cp ./Release/lightgbm.exe "$env:BUILD_ARTIFACTSTAGINGDIRECTORY"
} elseif ($env:TASK -eq "sdist") {
    sh ./build-python.sh sdist ; Assert-Output $?
    sh ./.ci/check-python-dists.sh ./dist ; Assert-Output $?
    Set-Location dist; pip install @(Get-ChildItem *.gz) -v ; Assert-Output $?
} elseif ($env:TASK -eq "bdist") {
    # Import the Chocolatey profile module so that the RefreshEnv command
    # invoked below properly updates the current PowerShell session environment.
    $module = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
    Import-Module "$module" ; Assert-Output $?
    RefreshEnv

    Write-Output "Current OpenCL drivers:"
    Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors

    conda activate $env:CONDA_ENV
    # TODO: restore --integrated-opencl as part of https://github.com/lightgbm-org/LightGBM/issues/6968
    sh "build-python.sh" bdist_wheel ; Assert-Output $?
    sh ./.ci/check-python-dists.sh ./dist ; Assert-Output $?
    Set-Location dist; pip install @(Get-ChildItem *py3-none-win_amd64.whl) ; Assert-Output $?
    cp @(Get-ChildItem *py3-none-win_amd64.whl) "$env:BUILD_ARTIFACTSTAGINGDIRECTORY"
} elseif (($env:APPVEYOR -eq "true") -and ($env:TASK -eq "python")) {
    if ($env:COMPILER -eq "MINGW") {
        sh ./build-python.sh install --mingw ; Assert-Output $?
    } else {
        sh ./build-python.sh install; Assert-Output $?
    }
}

if (($env:TASK -eq "sdist") -or (($env:APPVEYOR -eq "true") -and ($env:TASK -eq "python"))) {
    # cannot test C API with "sdist" task
    $tests = "$env:BUILD_SOURCESDIRECTORY/tests/python_package_test"
} else {
    $tests = "$env:BUILD_SOURCESDIRECTORY/tests"
}
if ($env:TASK -eq "bdist") {
    # Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py
    # TODO: set LIGHTGBM_TEST_DUAL_CPU_GPU back to "1" as part of https://github.com/lightgbm-org/LightGBM/issues/6968
    $env:LIGHTGBM_TEST_DUAL_CPU_GPU = "0"
}

pytest $tests ; Assert-Output $?

if (($env:TASK -eq "regular") -or (($env:APPVEYOR -eq "true") -and ($env:TASK -eq "python"))) {
    Set-Location "$env:BUILD_SOURCESDIRECTORY/examples/python-guide"
    @("import matplotlib", "matplotlib.use('Agg')") + (Get-Content "plot_example.py") | Set-Content "plot_example.py"
    # Prevent interactive window mode
    (Get-Content "plot_example.py").replace(
        'graph.render(view=True)',
        'graph.render(view=False)'
    ) | Set-Content "plot_example.py"
    conda install -y -n $env:CONDA_ENV "h5py>=3.10" "ipywidgets>=8.1.2" "notebook>=7.1.2"
    # Run all examples
    foreach ($file in @(Get-ChildItem *.py)) {
        @(
            "import sys, warnings",
            -join @(
                "warnings.showwarning = lambda message, category, filename, lineno, file=None, line=None: ",
                "sys.stdout.write(warnings.formatwarning(message, category, filename, lineno, line))"
            )
        ) + (Get-Content $file) | Set-Content $file
        python $file ; Assert-Output $?
    }
    # Run all notebooks
    Set-Location "$env:BUILD_SOURCESDIRECTORY/examples/python-guide/notebooks"
    (Get-Content "interactive_plot_example.ipynb").replace(
        'INTERACTIVE = False',
        'assert False, \"Interactive mode disabled\"'
    ) | Set-Content "interactive_plot_example.ipynb"
    jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb ; Assert-Output $?
}


================================================
FILE: .ci/test.sh
================================================
#!/bin/bash

set -e -E -o -u pipefail

# defaults
CONDA_ENV="test-env"
IN_UBUNTU_BASE_CONTAINER=${IN_UBUNTU_BASE_CONTAINER:-"false"}
METHOD=${METHOD:-""}
PRODUCES_ARTIFACTS=${PRODUCES_ARTIFACTS:-"false"}
SANITIZERS=${SANITIZERS:-""}

ARCH=$(uname -m)

LGB_VER=$(head -n 1 "${BUILD_DIRECTORY}/VERSION.txt")

# create the artifact upload directory if it doesn't exist yet
mkdir -p "${BUILD_ARTIFACTSTAGINGDIRECTORY}"

if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "gcc" ]]; then
    export CXX=g++-14
    export CC=gcc-14
elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang" ]]; then
    export CXX=clang++
    export CC=clang
elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang-17" ]]; then
    export CXX=clang++-17
    export CC=clang-17
fi

if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
    export LANG="en_US.UTF-8"
    export LC_ALL="en_US.UTF-8"
fi

# Setting MACOSX_DEPLOYMENT_TARGET prevents CMake from building against too-new
# macOS features, and helps tools like Python build tools determine the appropriate
# wheel compatibility tags.
#
# ref:
#   * https://cmake.org/cmake/help/latest/envvar/MACOSX_DEPLOYMENT_TARGET.html
#   * https://github.com/scikit-build/scikit-build-core/blob/acb7d0346e4a05bcb47a4ea3939c705ab71e3145/src/scikit_build_core/builder/macos.py#L36
if [[ $ARCH == "x86_64" ]]; then
    export MACOSX_DEPLOYMENT_TARGET=10.15
else
    export MACOSX_DEPLOYMENT_TARGET=12.0
fi

if [[ "${TASK}" == "r-package" ]]; then
    bash "${BUILD_DIRECTORY}/.ci/test-r-package.sh" || exit 1
    exit 0
fi

cd "${BUILD_DIRECTORY}"

if [[ $TASK == "swig" ]]; then
    cmake -B build -S . -DUSE_SWIG=ON
    cmake --build build -j4 || exit 1
    if [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "gcc" ]]; then
        objdump -T ./lib_lightgbm.so > ./objdump.log || exit 1
        objdump -T ./lib_lightgbm_swig.so >> ./objdump.log || exit 1
        ./.ci/check-dynamic-dependencies.sh ./objdump.log || exit 1
    fi
    if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
        cp ./build/lightgbmlib.jar "${BUILD_ARTIFACTSTAGINGDIRECTORY}/lightgbmlib_${OS_NAME}.jar"
    fi
    exit 0
fi

if [[ "$TASK" == "cpp-tests" ]]; then
    cmake_args=(
        -DBUILD_CPP_TEST=ON
        -DUSE_DEBUG=ON
    )
    if [[ $METHOD == "with-sanitizers" ]]; then
        cmake_args+=("-DUSE_SANITIZER=ON")
        if [[ -n $SANITIZERS ]]; then
            cmake_args+=("-DENABLED_SANITIZERS=$SANITIZERS")
        fi
    fi
    cmake -B build -S . "${cmake_args[@]}"
    cmake --build build --target testlightgbm -j4 || exit 1
    ./testlightgbm || exit 1
    exit 0
fi

# including python=version=[build=*_cp*] to ensure that conda prefers CPython and doesn't fall back to
# other implementations like pypy
CONDA_PYTHON_REQUIREMENT="python=${PYTHON_VERSION}[build=*_cp*]"

if [[ $TASK == "if-else" ]]; then
    conda create -q -y -n "${CONDA_ENV}" "${CONDA_PYTHON_REQUIREMENT}" numpy
    # shellcheck disable=SC1091
    source activate "${CONDA_ENV}"
    cmake -B build -S . || exit 1
    cmake --build build --target lightgbm -j4 || exit 1
    cd "$BUILD_DIRECTORY/tests/cpp_tests"
    ../../lightgbm config=train.conf convert_model_language=cpp convert_model=../../src/boosting/gbdt_prediction.cpp
    ../../lightgbm config=predict.conf output_result=origin.pred
    ../../lightgbm config=predict.conf output_result=ifelse.pred
    python test.py
    exit 0
fi

if [[ $PYTHON_VERSION == "3.9" ]]; then
    CONDA_REQUIREMENT_FILE="${BUILD_DIRECTORY}/.ci/conda-envs/ci-core-py39.txt"
else
    CONDA_REQUIREMENT_FILE="${BUILD_DIRECTORY}/.ci/conda-envs/ci-core.txt"
fi

conda create \
    -y \
    -n "${CONDA_ENV}" \
    --file "${CONDA_REQUIREMENT_FILE}" \
    "${CONDA_PYTHON_REQUIREMENT}" \
|| exit 1

# print output of 'conda list', to help in submitting bug reports
echo "conda list:"
conda list -n ${CONDA_ENV}

# shellcheck disable=SC1091
source activate $CONDA_ENV

cd "${BUILD_DIRECTORY}"

if [[ $TASK == "sdist" ]]; then
    sh ./build-python.sh sdist || exit 1
    sh .ci/check-python-dists.sh ./dist || exit 1
    pip install "./dist/lightgbm-${LGB_VER}.tar.gz" -v || exit 1
    if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
        cp "./dist/lightgbm-${LGB_VER}.tar.gz" "${BUILD_ARTIFACTSTAGINGDIRECTORY}" || exit 1
    fi
    pytest ./tests/python_package_test || exit 1
    exit 0
elif [[ $TASK == "bdist" ]]; then
    if [[ $OS_NAME == "macos" ]]; then
        sh ./build-python.sh bdist_wheel || exit 1
        sh .ci/check-python-dists.sh ./dist || exit 1
        if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
            cp "$(echo "dist/lightgbm-${LGB_VER}-py3-none-macosx"*.whl)" "${BUILD_ARTIFACTSTAGINGDIRECTORY}" || exit 1
        fi
    else
        sh ./build-python.sh bdist_wheel --integrated-opencl || exit 1

        # print some debugging logs about the wheel's GLIBC version and dependencies on shared libraries
        pip install 'auditwheel>=6.5.1'
        auditwheel show ./dist/lightgbm*.whl

        # pass through 'auditwheel repair' to set the appropriate wheel tags.
        #
        # intentionally avoid vendoring libgomp, to reduce the risk of multiple OpenMP libraries
        # being loaded in the same process.
        auditwheel repair \
            --exclude 'libgomp.so*' \
            --lib-sdir '' \
            --wheel-dir dist-fixed/ \
            ./dist/lightgbm*.whl

        # overwrite the original wheel with the new one
        rm ./dist/lightgbm*.whl
        mv ./dist-fixed/lightgbm*.whl ./dist

        # check wheel properties
        sh .ci/check-python-dists.sh ./dist || exit 1

        if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
            # hard-code expected tag so CI will fail if 'auditwheel repair' has a surprising result (e.g. newer
            # manylinux tag than we intended)
            if [[ $ARCH == "x86_64" ]]; then
                PLATFORM="manylinux_2_27_x86_64.manylinux_2_28_x86_64"
            else
                PLATFORM="manylinux2014_aarch64.manylinux_2_17_aarch64"
            fi
            cp "dist/lightgbm-${LGB_VER}-py3-none-${PLATFORM}.whl" "${BUILD_ARTIFACTSTAGINGDIRECTORY}" || exit 1
        fi
        # Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py
        export LIGHTGBM_TEST_DUAL_CPU_GPU=1
    fi
    pip install -v ./dist/*.whl || exit 1
    pytest ./tests || exit 1
    exit 0
fi

if [[ $TASK == "gpu" ]]; then
    sed -i'.bak' 's/std::string device_type = "cpu";/std::string device_type = "gpu";/' ./include/LightGBM/config.h
    grep -q 'std::string device_type = "gpu"' ./include/LightGBM/config.h || exit 1  # make sure that changes were really done
    if [[ $METHOD == "pip" ]]; then
        sh ./build-python.sh sdist || exit 1
        sh .ci/check-python-dists.sh ./dist || exit 1
        pip install \
            -v \
            --config-settings=cmake.define.USE_GPU=ON \
            "./dist/lightgbm-${LGB_VER}.tar.gz" \
        || exit 1
        pytest ./tests/python_package_test || exit 1
        exit 0
    elif [[ $METHOD == "wheel" ]]; then
        sh ./build-python.sh bdist_wheel --gpu || exit 1
        sh ./.ci/check-python-dists.sh ./dist || exit 1
        pip install "$(echo "./dist/lightgbm-${LGB_VER}"*.whl)" -v || exit 1
        pytest ./tests || exit 1
        exit 0
    elif [[ $METHOD == "source" ]]; then
        cmake -B build -S . -DUSE_GPU=ON
    fi
elif [[ $TASK == "cuda" ]]; then
    sed -i'.bak' 's/std::string device_type = "cpu";/std::string device_type = "cuda";/' ./include/LightGBM/config.h
    grep -q 'std::string device_type = "cuda"' ./include/LightGBM/config.h || exit 1  # make sure that changes were really done
    # by default ``gpu_use_dp=false`` for efficiency. change to ``true`` here for exact results in ci tests
    sed -i'.bak' 's/gpu_use_dp = false;/gpu_use_dp = true;/' ./include/LightGBM/config.h
    grep -q 'gpu_use_dp = true' ./include/LightGBM/config.h || exit 1  # make sure that changes were really done
    if [[ $METHOD == "pip" ]]; then
        sh ./build-python.sh sdist || exit 1
        sh ./.ci/check-python-dists.sh ./dist || exit 1
        pip install \
            -v \
            --config-settings=cmake.define.USE_CUDA=ON \
            "./dist/lightgbm-${LGB_VER}.tar.gz" \
        || exit 1
        pytest ./tests/python_package_test || exit 1
        exit 0
    elif [[ $METHOD == "wheel" ]]; then
        sh ./build-python.sh bdist_wheel --cuda || exit 1
        sh ./.ci/check-python-dists.sh ./dist || exit 1
        pip install "$(echo "./dist/lightgbm-${LGB_VER}"*.whl)" -v || exit 1
        pytest ./tests || exit 1
        exit 0
    elif [[ $METHOD == "source" ]]; then
        cmake -B build -S . -DUSE_CUDA=ON
    fi
elif [[ $TASK == "mpi" ]]; then
    if [[ $METHOD == "pip" ]]; then
        sh ./build-python.sh sdist || exit 1
        sh ./.ci/check-python-dists.sh ./dist || exit 1
        pip install \
            -v \
            --config-settings=cmake.define.USE_MPI=ON \
            "./dist/lightgbm-${LGB_VER}.tar.gz" \
        || exit 1
        pytest ./tests/python_package_test || exit 1
        exit 0
    elif [[ $METHOD == "wheel" ]]; then
        sh ./build-python.sh bdist_wheel --mpi || exit 1
        sh ./.ci/check-python-dists.sh ./dist || exit 1
        pip install "$(echo "./dist/lightgbm-${LGB_VER}"*.whl)" -v || exit 1
        pytest ./tests || exit 1
        exit 0
    elif [[ $METHOD == "source" ]]; then
        cmake -B build -S . -DUSE_MPI=ON -DUSE_DEBUG=ON
    fi
else
    cmake -B build -S .
fi

cmake --build build --target _lightgbm -j4 || exit 1

sh ./build-python.sh install --precompile || exit 1
pytest ./tests || exit 1

if [[ $TASK == "regular" ]]; then
    if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
        if [[ $OS_NAME == "macos" ]]; then
            cp ./lib_lightgbm.dylib "${BUILD_ARTIFACTSTAGINGDIRECTORY}/lib_lightgbm.dylib"
        else
            if [[ $COMPILER == "gcc" ]]; then
                objdump -T ./lib_lightgbm.so > ./objdump.log || exit 1
                ./.ci/check-dynamic-dependencies.sh ./objdump.log || exit 1
            fi
            cp ./lib_lightgbm.so "${BUILD_ARTIFACTSTAGINGDIRECTORY}/lib_lightgbm.so"
        fi
    fi
    cd "$BUILD_DIRECTORY/examples/python-guide"
    sed -i'.bak' '/import lightgbm as lgb/a\
import matplotlib\
matplotlib.use\(\"Agg\"\)\
' plot_example.py  # prevent interactive window mode
    sed -i'.bak' 's/graph.render(view=True)/graph.render(view=False)/' plot_example.py
    # requirements for examples
    conda install -y -n $CONDA_ENV \
        'h5py>=3.10' \
        'ipywidgets>=8.1.2' \
        'notebook>=7.1.2'
    for f in *.py **/*.py; do python "${f}" || exit 1; done  # run all examples
    cd "$BUILD_DIRECTORY/examples/python-guide/notebooks"
    sed -i'.bak' 's/INTERACTIVE = False/assert False, \\"Interactive mode disabled\\"/' interactive_plot_example.ipynb
    jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace ./*.ipynb || exit 1  # run all notebooks

    # importing the library should succeed even if all optional dependencies are not present
    conda uninstall -n $CONDA_ENV --force --yes \
        cffi \
        dask \
        distributed \
        joblib \
        matplotlib-base \
        pandas \
        psutil \
        pyarrow \
        python-graphviz \
        scikit-learn || exit 1
    python -c "import lightgbm" || exit 1
fi


================================================
FILE: .editorconfig
================================================
root = true

[*]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
indent_style = space
indent_size = 2

[*.{py,sh,ps1,js,json}]
indent_size = 4
max_line_length = 120
skip = external_libs
known_first_party = lightgbm

# Tabs matter for Makefile and .gitmodules
[{makefile*,Makefile*,*.mk,*.mak,*.makefile,*.Makefile,GNUmakefile,BSDmakefile,make.bat,Makevars*,*.gitmodules}]
indent_style = tab


================================================
FILE: .git-blame-ignore-revs
================================================
# introduce ruff-format (#6308)
6330d6269c81dfd4c96e664b99239b8ff39ccf91
# enable ruff format on tests and examples (#6317)
1b792e716682254c33ddb5eb845357e84018636d
# enable ruff-format on main library Python code (#6336)
dd31208ab7a7aea86762830697b00666f843ded9
# enable whitespace/indent_namespace rule from cpplint (#7056)
50f11a9f3c066eadee475ea567f9e9d49e6bb827


================================================
FILE: .github/CODEOWNERS
================================================
# This file controls default reviewers for LightGBM code.
# See https://help.github.com/en/articles/about-code-owners
# for details
#
# Maintainers are encouraged to use their best discretion in
# setting reviewers on PRs manually, but this file should
# offer a reasonable automatic best-guess

# catch-all rule (this only gets matched if no rules below match)
*    @guolinke @jameslamb @shiyu1994 @jmoralez @borchero @StrikerRUS


================================================
FILE: .github/ISSUE_TEMPLATE/BUG_REPORT.md
================================================
---
name: Bug Report 🐞
about: Something isn't working as expected? Here is the right place to report.
---

## Description
<!-- A clear description of the bug -->

## Reproducible example
<!-- Minimal code that exhibits this behavior -->

## Environment info

LightGBM version or commit hash:

Command(s) you used to install LightGBM

```shell

```

<!-- Put any additional environment information here -->


## Additional Comments
<!-- What else should we know? -->


================================================
FILE: .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
================================================
---
name: Feature Request 💡
about: Suggest a new idea for the project.
labels: enhancement, feature-request
---

<!--
Please search your feature on previous issues and our feature requests consolidation hub (https://github.com/lightgbm-org/LightGBM/issues/2302) before you open a new one.
-->

## Summary

<!-- Briefly explain your feature proposal. -->

## Motivation

<!-- Why is it useful to have this feature in the LightGBM project? -->

## Description

<!-- Detailed description of the new feature. -->

## References

<!-- Any useful references, for instance, papers, implementations in other projects, draft code snippets, etc. -->


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: github-actions
    directory: /
    schedule:
      interval: monthly
    groups:
      ci-dependencies:
        patterns:
          - "*"
    cooldown:
      # only accept releases that have been out for at least 15 days
      default-days: 15
    commit-message:
      prefix: "[ci]"
    labels:
      - maintenance


================================================
FILE: .github/release-drafter.yml
================================================
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
  - title: '💡 New Features'
    label: 'feature'
  - title: '🔨 Breaking'
    label: 'breaking'
  - title: '🚀 Efficiency Improvement'
    label: 'efficiency'
  - title: '🐛 Bug Fixes'
    label: 'fix'
  - title: '📖 Documentation'
    label: 'doc'
  - title: '🧰 Maintenance'
    label: 'maintenance'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
  ## Changes

  $CHANGES


================================================
FILE: .github/workflows/build.yml
================================================
# builds core artifacts, intended to be attached to releases
# or used by other workflows
name: Build

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

# automatically cancel in-progress builds if another commit is pushed
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  # tell scripts where to put artifacts
  BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'

jobs:
  archive:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Create source archive
        run: |
          mkdir -p "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
          tar \
            -czvf \
            /tmp/LightGBM-complete_source_code_tar_gz.tar.gz \
            .
          mv \
            /tmp/LightGBM-complete_source_code_tar_gz.tar.gz \
            ${BUILD_ARTIFACTSTAGINGDIRECTORY}/
      - name: Create commit.txt
        shell: bash
        run: |
          # for pull requests, github.sha refers to the merge commit from merging the PR and
          # target branch... we want the actual commit that was pushed
          if [[ "${{ github.event_name }}" == "pull_request" ]]; then
            COMMIT_SHA="${{ github.event.pull_request.head.sha }}"
          else
            COMMIT_SHA="${{ github.sha }}"
          fi
          echo "${COMMIT_SHA}" > "${BUILD_ARTIFACTSTAGINGDIRECTORY}/commit.txt"
      - name: Upload artifacts
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f  # v7.0.0
        with:
          name: source-archive
          path: |
            ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/commit.txt
            ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/LightGBM-complete_source_code_tar_gz.tar.gz
          if-no-files-found: error
  all-build-jobs-successful:
    if: always()
    runs-on: ubuntu-latest
    needs:
      - archive
    steps:
      - name: Note that all tests succeeded
        uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe  # v1.2.2
        with:
          jobs: ${{ toJSON(needs) }}


================================================
FILE: .github/workflows/cpp.yml
================================================
name: C++

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

# automatically cancel in-progress builds if another commit is pushed
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  # tell scripts where to put artifacts
  # (this variable name is left over from when jobs ran on Azure DevOps)
  BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
  # where repo sources are cloned to
  BUILD_DIRECTORY: '${{ github.workspace }}'
  # in CMake-driven builds, parallelize compilation
  CMAKE_BUILD_PARALLEL_LEVEL: 4

jobs:
  test:
    name: ${{ matrix.task }} (${{ matrix.os-display-name || matrix.os }}, ${{ matrix.compiler }})
    runs-on: ${{ matrix.os }}
    container: ${{ matrix.container }}
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        include:
          #############
          # C++ tests #
          #############
          - os: ubuntu-latest
            task: cpp-tests
            compiler: clang-17
            method: with-sanitizers
            container: 'ubuntu:22.04'
            os-display-name: 'ubuntu22.04'
          - os: macos-15-intel
            task: cpp-tests
            compiler: clang
            method: with-sanitizers
            sanitizers: "address;undefined"
            container: null
          - os: windows-2022
            task: cpp-tests
            compiler: msvc
            container: null
          ###########
          # if-else #
          ###########
          # These test CLI-generated C++ inference code.
          #
          # They need Python because they're written with pytest, but they
          # do not need the LightGBM Python package
          - os: ubuntu-latest
            task: if-else
            compiler: clang-17
            container: 'ubuntu:22.04'
            os-display-name: 'ubuntu22.04'
            python_version: '3.13'
            setup-conda: 'true'
          - os: macos-15-intel
            task: if-else
            compiler: clang
            python_version: '3.10'
            container: null
          - os: ubuntu-latest
            task: if-else
            compiler: gcc
            python_version: '3.11'
            container: 'lightgbm.azurecr.io/vsts-agent:manylinux_2_28_x86_64'
            os-display-name: 'manylinux_2_28'
    steps:
      - name: Install packages used by third-party actions
        if: matrix.container == 'ubuntu:22.04'
        shell: bash
        run: |
          apt-get update -y
          apt-get install --no-install-recommends -y \
            dirmngr \
            gpg \
            gpg-agent \
            software-properties-common \
            sudo
          # install newest version of git
          # ref:
          #     - https://unix.stackexchange.com/a/170831/550004
          #     - https://git-scm.com/download/linux
          add-apt-repository ppa:git-core/ppa -y
          apt-get update -y
          apt-get install --no-install-recommends -y \
            git
      - name: Trust git cloning LightGBM
        if: startsWith(matrix.os, 'ubuntu')
        run: |
          git config --global --add safe.directory "${GITHUB_WORKSPACE}"
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Setup and run tests on Linux and macOS
        if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
        shell: bash
        run: |
          export COMPILER="${{ matrix.compiler }}"
          export CONDA="${HOME}/miniforge"
          export METHOD="${{ matrix.method }}"
          export PATH=${CONDA}/bin:${PATH}
          export PYTHON_VERSION="${{ matrix.python_version }}"
          export SANITIZERS="${{ matrix.sanitizers }}"
          export SETUP_CONDA="${{ matrix.setup-conda }}"
          export TASK="${{ matrix.task }}"
          if [[ "${{ matrix.os }}" =~ ^macos ]]; then
              export OS_NAME="macos"
          elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
              export OS_NAME="linux"
          fi
          if [[ "${{ matrix.container }}" == "ubuntu:22.04" ]]; then
            export DEBIAN_FRONTEND=noninteractive
            export IN_UBUNTU_BASE_CONTAINER="true"
          fi
          $GITHUB_WORKSPACE/.ci/setup.sh
          $GITHUB_WORKSPACE/.ci/test.sh
      - name: Setup and run tests on Windows
        if: startsWith(matrix.os, 'windows')
        shell: pwsh -command ". {0}"
        run: |
          $env:BUILD_SOURCESDIRECTORY = $env:BUILD_DIRECTORY
          $env:TASK = "${{ matrix.task }}"
          & "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1"
  all-cpp-jobs-successful:
    if: always()
    runs-on: ubuntu-latest
    needs:
      - test
    steps:
      - name: Note that all tests succeeded
        uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe  # v1.2.2
        with:
          jobs: ${{ toJSON(needs) }}


================================================
FILE: .github/workflows/cuda.yml
================================================
name: CUDA Version

on:
  # Run manually by clicking a button in the UI
  workflow_dispatch:

# automatically cancel in-progress builds if another commit is pushed
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  test:
    # yamllint disable-line rule:line-length
    name: ${{ matrix.task }} ${{ matrix.cuda_version }} ${{ matrix.method }} (${{ matrix.linux_version }}, ${{ matrix.compiler }}, Python ${{ matrix.python_version }})
    # yamllint disable-line rule:line-length
    # ref: https://docs.github.com/en/actions/concepts/runners/about-larger-runners#specifications-for-gpu-larger-runners
    runs-on: github-hosted-linux-gpu-amd64
    container:
      image: nvcr.io/nvidia/cuda:${{ matrix.cuda_version }}-devel-${{ matrix.linux_version }}
      env:
        CMAKE_BUILD_PARALLEL_LEVEL: 4
        COMPILER: ${{ matrix.compiler }}
        CONDA: /tmp/miniforge
        DEBIAN_FRONTEND: noninteractive
        METHOD: ${{ matrix.method }}
        OS_NAME: linux
        PYTHON_VERSION: ${{ matrix.python_version }}
        TASK: ${{ matrix.task }}
        SKBUILD_STRICT_CONFIG: true
      options: --gpus all
    timeout-minutes: 30
    strategy:
      fail-fast: false
      matrix:
        include:
          - method: wheel
            compiler: gcc
            python_version: "3.11"
            cuda_version: "12.8.0"
            linux_version: "ubuntu22.04"
            task: cuda
          - method: source
            compiler: gcc
            python_version: "3.13"
            cuda_version: "12.2.2"
            linux_version: "ubuntu22.04"
            task: cuda
          - method: pip
            compiler: clang
            python_version: "3.12"
            cuda_version: "11.8.0"
            linux_version: "ubuntu20.04"
            task: cuda
    steps:
      - name: Install latest git and sudo
        run: |
          apt-get update
          apt-get install --no-install-recommends -y \
              ca-certificates \
              software-properties-common
          add-apt-repository ppa:git-core/ppa -y
          apt-get update
          apt-get install --no-install-recommends -y \
              git \
              sudo
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Setup and run tests
        run: |
          export BUILD_ARTIFACTSTAGINGDIRECTORY="${{ github.workspace }}/artifacts"
          export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
          export PATH=$CONDA/bin:$PATH

          # check GPU usage
          nvidia-smi

          # build and test
          $GITHUB_WORKSPACE/.ci/setup.sh
          $GITHUB_WORKSPACE/.ci/test.sh
  all-cuda-jobs-successful:
    if: always()
    runs-on: ubuntu-latest
    needs: [test]
    steps:
      - name: Note that all tests succeeded
        uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe  # v1.2.2
        with:
          jobs: ${{ toJSON(needs) }}


================================================
FILE: .github/workflows/lock.yml
================================================
name: 'Lock Inactive Threads'

on:
  schedule:
    # midnight UTC, every Wednesday, for Issues
    - cron: '0 0 * * 3'
    # midnight UTC, every Thursday, for PRs
    - cron: '0 0 * * 4'
  # allow manual triggering from GitHub UI
  workflow_dispatch:

permissions:
  issues: write
  pull-requests: write

concurrency:
  group: lock

jobs:
  action:
    runs-on: ubuntu-latest
    steps:
      - uses: dessant/lock-threads@7266a7ce5c1df01b1c6db85bf8cd86c737dadbe7  # v6.0.0
        with:
          github-token: ${{ github.token }}
          # after how many days of inactivity should a closed issue/PR be locked?
          issue-inactive-days: '365'
          pr-inactive-days: '365'
          # do not close feature request issues...
          # we close those but track them in https://github.com/lightgbm-org/LightGBM/issues/2302
          exclude-any-issue-labels: 'feature request'
          # what labels should be removed prior to locking?
          remove-issue-labels: 'awaiting response,awaiting review,blocking,in progress'
          remove-pr-labels: 'awaiting response,awaiting review,blocking,in progress'
          # what message should be posted prior to locking?
          issue-comment: >
            This issue has been automatically locked
            since there has not been any recent activity since it was closed.

            To start a new related discussion,
            open a new issue at https://github.com/lightgbm-org/LightGBM/issues
            including a reference to this.
          pr-comment: >
            This pull request has been automatically locked
            since there has not been any recent activity since it was closed.

            To start a new related discussion,
            open a new issue at https://github.com/lightgbm-org/LightGBM/issues
            including a reference to this.
          # what should the locking status be?
          issue-lock-reason: 'resolved'
          pr-lock-reason: 'resolved'
          process-only: ${{ github.event.schedule == '0 0 * * 3' && 'issues' || 'prs' }}


================================================
FILE: .github/workflows/lychee.yml
================================================
name: Link checks

on:
  # Run manually by clicking a button in the UI
  workflow_dispatch:
  # Run once a day at 8:00am UTC
  schedule:
    - cron: '0 8 * * *'

env:
  COMPILER: gcc
  OS_NAME: 'linux'
  TASK: 'check-links'

jobs:
  check-links:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: false
      - name: Build docs
        run: |
          export CONDA=${HOME}/miniforge
          export PATH=${CONDA}/bin:${HOME}/.local/bin:${PATH}
          $GITHUB_WORKSPACE/.ci/setup.sh || exit 1
          $GITHUB_WORKSPACE/.ci/build-docs.sh || exit 1
      - name: Check links
        uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411  # v2.8.0
        with:
          args: >-
            --config=./docs/.lychee.toml
            --
            "**/*.rst"
            "**/*.md"
            "./R-package/**/*.Rd"
            "./docs/_build/html/*.html"
          fail: true
          failIfEmpty: true


================================================
FILE: .github/workflows/no_response.yml
================================================
name: No Response Bot

permissions:
  issues: write
  pull-requests: write

on:
  issue_comment:
    types: [created]
  schedule:
    # "every day at 04:00 UTC"
    - cron: '0 4 * * *'

jobs:
  noResponse:
    runs-on: ubuntu-latest
    steps:
      - uses: lee-dohm/no-response@9bb0a4b5e6a45046f00353d5de7d90fb8bd773bb  # v0.5.0
        with:
          closeComment: >
              This issue has been automatically closed
              because it has been awaiting a response for too long.

              When you have time to to work with the maintainers to resolve this issue,
              please post a new comment and it will be re-opened.
              If the issue has been locked for editing by the time you return to it,
              please open a new issue and reference this one.

              Thank you for taking the time to improve LightGBM!
          daysUntilClose: 30
          responseRequiredLabel: awaiting response
          token: ${{ github.token }}


================================================
FILE: .github/workflows/optional_checks.yml
================================================
name: Optional checks

on:
  pull_request:
    branches:
      - master

jobs:
  all-optional-checks-successful:
    timeout-minutes: 30
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ github.token }}
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: false
      - name: Check valgrind workflow
        shell: bash
        run: |
            # ref: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context
            PR_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
            echo "checking status for branch '${PR_BRANCH}'"
            ./.ci/check-workflow-status.sh \
                "${PR_BRANCH}" \
                'r_valgrind.yml' \
                ${{ github.event.number }}


================================================
FILE: .github/workflows/python_package.yml
================================================
name: Python-package

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

# automatically cancel in-progress builds if another commit is pushed
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  # tell scripts where to put artifacts
  # (this variable name is left over from when jobs ran on Azure DevOps)
  BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
  # where repo sources are cloned to
  BUILD_SOURCESDIRECTORY: '${{ github.workspace }}'
  CMAKE_BUILD_PARALLEL_LEVEL: 4
  # avoid interactive prompts in Debian-based distributions
  DEBIAN_FRONTEND: noninteractive
  # On runners using nvidia-container-runtime with Docker, ensure GPUs are available to running processes.
  #
  # ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html
  NVIDIA_VISIBLE_DEVICES: 'all'
  SKBUILD_STRICT_CONFIG: true

jobs:
  test-linux-aarch64:
    name: bdist wheel (manylinux2014-arm, gcc, Python 3.13)
    runs-on: ubuntu-24.04-arm
    timeout-minutes: 60
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Setup and run tests
        shell: bash
        # this uses 'docker run' instead of just setting 'container:'
        # because actions/checkout requires GLIBC 2.28 and that is too
        # new for manylinux2014
        env:
          BUILD_DIRECTORY: /LightGBM
        run: |
          cat > ./docker-script.sh <<EOF
          mkdir -p \$BUILD_ARTIFACTSTAGINGDIRECTORY
          export CONDA=\$HOME/miniforge
          export PATH=\$CONDA/bin:\$PATH
          ${{ env.BUILD_DIRECTORY }}/.ci/setup.sh || exit 1
          ${{ env.BUILD_DIRECTORY }}/.ci/test.sh || exit 1
          EOF
          IMAGE_URI="lightgbm/vsts-agent:manylinux2014_aarch64"
          docker pull "${IMAGE_URI}" || exit 1
          docker run \
            --platform "${PLATFORM}" \
            --rm \
            --env BUILD_DIRECTORY=${{ env.BUILD_DIRECTORY }} \
            --env BUILD_ARTIFACTSTAGINGDIRECTORY=${{ env.BUILD_DIRECTORY }}/artifacts/ \
            --env COMPILER=gcc \
            --env METHOD=wheel \
            --env OS_NAME=linux \
            --env PRODUCES_ARTIFACTS=true \
            --env PYTHON_VERSION="3.13" \
            --env TASK=bdist \
            -v "${PWD}":"${{ env.BUILD_DIRECTORY }}" \
            -w ${{ env.BUILD_DIRECTORY }} \
            "${IMAGE_URI}" \
            /bin/bash ./docker-script.sh
      - name: Upload artifacts
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f  # v7.0.0
        with:
          name: linux-aarch64-wheel
          path: artifacts/*.whl
          if-no-files-found: error
  test:
    # yamllint disable-line rule:line-length
    name: ${{ matrix.task }} ${{ matrix.method }} (${{ matrix.os-display-name || matrix.os }}, ${{ matrix.compiler }}, Python ${{ matrix.python_version }})
    runs-on: ${{ matrix.os }}
    container: ${{ matrix.container }}
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: macos-15-intel
            task: regular
            compiler: gcc
            python_version: '3.11'
          - os: macos-15-intel
            task: sdist
            compiler: clang
            python_version: '3.10'
          - os: macos-15-intel
            task: sdist
            compiler: gcc
            python_version: '3.12'
          - os: macos-15-intel
            task: bdist
            method: wheel
            compiler: gcc
            python_version: '3.9'
          - os: windows-2022
            task: sdist
            compiler: MSVC
            python_version: '3.10'
          - os: ubuntu-latest
            container: &ubuntu_latest_image ubuntu:22.04
            os-display-name: &ubuntu_latest_display_name 'ubuntu22.04'
            task: regular
            compiler: clang-17
            python_version: '3.13'
            in-ubuntu-base-container: 'true'
          - os: ubuntu-latest
            container: *ubuntu_latest_image
            os-display-name: *ubuntu_latest_display_name
            task: sdist
            compiler: clang-17
            python_version: '3.13'
            in-ubuntu-base-container: 'true'
          #########################
          # OpenCL-based GPU jobs #
          #########################
          # clang-17 jobs are run on machines with actual GPUs because
          # the package built with that compiler toolchain can't target the
          # CPUs on GitHub's runners.
          #
          # ref: https://github.com/lightgbm-org/LightGBM/pull/7096/files#r2590879590
          # TODO(jameslamb): restore these GPU jobs when we've clarified handling of GPU CI
          #             ref: https://github.com/lightgbm-org/LightGBM/issues/7187
          # - os: github-hosted-linux-gpu-amd64
          #   container: nvcr.io/nvidia/cuda:12.9.1-devel-ubuntu22.04
          #   os-display-name: ubuntu22.04-with-gpu
          #   task: bdist
          #   compiler: clang-17
          #   method: wheel
          #   python_version: '3.11'
          #   in-ubuntu-base-container: 'true'
          # - os: github-hosted-linux-gpu-amd64
          #   container: nvcr.io/nvidia/cuda:12.9.1-devel-ubuntu22.04
          #   os-display-name: ubuntu22.04-with-gpu
          #   task: gpu
          #   compiler: clang-17
          #   method: source
          #   python_version: '3.12'
          #   in-ubuntu-base-container: 'true'
          - os: ubuntu-latest
            container: &manylinux_amd64_image lightgbm.azurecr.io/vsts-agent:manylinux_2_28_x86_64
            os-display-name: &manylinux_amd64_display_name 'manylinux_2_28'
            task: gpu
            method: source
            compiler: gcc
            python_version: '3.13'
            in-ubuntu-base-container: 'false'
            setup-conda: 'false'
          ############
          # MPI jobs #
          ############
          - os: macos-15-intel
            task: mpi
            compiler: gcc
            method: source
            python_version: '3.12'
          - os: macos-15-intel
            task: mpi
            compiler: gcc
            method: pip
            python_version: '3.13'
          - os: macos-15-intel
            task: mpi
            compiler: gcc
            method: wheel
            python_version: '3.10'
          - os: ubuntu-latest
            container: *manylinux_amd64_image
            os-display-name: *manylinux_amd64_display_name
            task: mpi
            compiler: gcc
            method: source
            python_version: '3.10'
            in-ubuntu-base-container: 'false'
            setup-conda: 'false'
          - os: ubuntu-latest
            container: *ubuntu_latest_image
            os-display-name: *ubuntu_latest_display_name
            task: mpi
            compiler: clang-17
            method: source
            python_version: '3.13'
            in-ubuntu-base-container: 'true'
          - os: ubuntu-latest
            container: *ubuntu_latest_image
            os-display-name: *ubuntu_latest_display_name
            task: mpi
            compiler: clang-17
            method: pip
            python_version: '3.12'
            in-ubuntu-base-container: 'true'
          - os: ubuntu-latest
            container: *ubuntu_latest_image
            os-display-name: *ubuntu_latest_display_name
            task: mpi
            compiler: clang-17
            method: wheel
            python_version: '3.10'
            in-ubuntu-base-container: 'true'
          #####################
          # jobs that create  #
          # release artifacts #
          #####################
          - os: macos-15-intel
            task: bdist
            compiler: clang
            method: wheel
            produces-artifacts: 'true'
            artifact-name: 'macosx-amd64-wheel'
            python_version: '3.13'
          - os: macos-14
            task: bdist
            compiler: clang
            method: wheel
            produces-artifacts: 'true'
            artifact-name: 'macosx-arm64-wheel'
            python_version: '3.11'
          - os: macos-15-intel
            task: regular
            compiler: clang
            produces-artifacts: 'true'
            artifact-name: 'macosx-amd64-liblightgbm'
            python_version: '3.11'
          - os: ubuntu-latest
            container: *manylinux_amd64_image
            os-display-name: *manylinux_amd64_display_name
            task: regular
            compiler: gcc
            python_version: '3.11'
            in-ubuntu-base-container: 'false'
            setup-conda: 'false'
            produces-artifacts: 'true'
            artifact-name: 'linux-amd64-liblightgbm'
          - os: ubuntu-latest
            container: *manylinux_amd64_image
            os-display-name: *manylinux_amd64_display_name
            task: bdist
            compiler: gcc
            method: wheel
            python_version: '3.10'
            in-ubuntu-base-container: 'false'
            setup-conda: 'false'
            produces-artifacts: 'true'
            artifact-name: 'linux-amd64-wheel'
          - os: ubuntu-latest
            container: *manylinux_amd64_image
            os-display-name: *manylinux_amd64_display_name
            task: sdist
            compiler: gcc
            python_version: '3.9'
            in-ubuntu-base-container: 'false'
            setup-conda: 'false'
            produces-artifacts: 'true'
            artifact-name: 'sdist'
          - os: windows-2022
            task: bdist
            compiler: MSVC
            method: wheel
            produces-artifacts: 'true'
            artifact-name: 'windows-amd64-wheel'
            python_version: '3.13'
          - os: windows-2022
            task: regular
            compiler: MSVC
            produces-artifacts: 'true'
            artifact-name: 'windows-amd64-cli-and-liblightgbm'
            python_version: '3.11'
    steps:
      - name: Install packages used by third-party actions
        if: ${{ matrix.in-ubuntu-base-container == 'true' }}
        shell: bash
        run: |
          apt-get update -y
          apt-get install --no-install-recommends -y \
            ca-certificates \
            dirmngr \
            gpg \
            gpg-agent \
            software-properties-common \
            sudo
          # install newest version of git
          # ref:
          #     - https://unix.stackexchange.com/a/170831/550004
          #     - https://git-scm.com/download/linux
          add-apt-repository ppa:git-core/ppa -y
          apt-get update -y
          apt-get install --no-install-recommends -y \
            git
      - name: Trust git cloning LightGBM
        if: startsWith(matrix.os, 'ubuntu')
        run: |
          git config --global --add safe.directory "${GITHUB_WORKSPACE}"
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Setup and run tests on Linux and macOS
        if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') || endsWith(matrix.os, 'gpu-amd64')
        shell: bash
        run: |
          export COMPILER="${{ matrix.compiler }}"
          export IN_UBUNTU_BASE_CONTAINER="${{ matrix.in-ubuntu-base-container }}"
          export SETUP_CONDA="${{ matrix.setup-conda }}"
          export TASK="${{ matrix.task }}"
          export METHOD="${{ matrix.method }}"
          if [[ "${{ matrix.os }}" =~ ^macos ]]; then
              export OS_NAME="macos"
          elif \
            [[ "${{ matrix.os }}" == "ubuntu-latest" ]] \
            || [[ "${{ matrix.os }}" == "github-hosted-linux-gpu-amd64" ]];
          then
              export OS_NAME="linux"
              export PATH="/usr/lib64/openmpi/bin:${PATH}"
          fi
          export PYTHON_VERSION="${{ matrix.python_version }}"
          export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
          # some pre-built images already have 'CONDA' set
          if [[ -z "${CONDA:-}" ]]; then
            export CONDA=${HOME}/miniforge
          fi
          export PATH=${CONDA}/bin:${PATH}
          export PRODUCES_ARTIFACTS="${{ matrix.produces-artifacts }}"
          $GITHUB_WORKSPACE/.ci/setup.sh || exit 1
          $GITHUB_WORKSPACE/.ci/test.sh || exit 1
      - name: Install OpenCL on Windows
        if: startsWith(matrix.os, 'windows') && (matrix.task == 'bdist')
        shell: pwsh -command ". {0}"
        run: |
          & "$env:GITHUB_WORKSPACE/.ci/install-opencl.ps1"
      # 'conda init powershell' needs to be run in a separate process
      # ref: https://docs.conda.io/projects/conda/en/stable/dev-guide/deep-dives/activation.html
      - name: Initialize conda on Windows
        if: startsWith(matrix.os, 'windows')
        shell: pwsh -command ". {0}"
        run: |
          $env:PATH = "$env:CONDA/Scripts;$env:PATH"
          conda init powershell
      - name: Setup and run tests on Windows
        if: startsWith(matrix.os, 'windows')
        shell: pwsh -command ". {0}"
        run: |
          $env:COMPILER = "${{ matrix.compiler }}"
          $env:METHOD = "${{ matrix.method }}"
          $env:PRODUCES_ARTIFACTS = "${{ matrix.produces-artifacts }}"
          $env:PYTHON_VERSION = "${{ matrix.python_version }}"
          $env:TASK = "${{ matrix.task }}"
          & "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1"
      - name: Upload artifacts
        if: ${{ matrix.produces-artifacts == 'true' }}
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f  # v7.0.0
        with:
          name: ${{ matrix.artifact-name }}
          path: |
            artifacts/*.dll
            artifacts/*.dylib
            artifacts/*.exe
            artifacts/*.so
            artifacts/*.tar.gz
            artifacts/*.whl
          if-no-files-found: error
  create-nuget:
    name: NuGet package
    runs-on: ubuntu-latest
    timeout-minutes: 30
    needs: [test]
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: false
      - name: Download lib_lightgbm (all operating systems) and Windows CLI
        uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3  # v8.0.0
        with:
          merge-multiple: true
          path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}
          pattern: '*amd64*-liblightgbm'
          run-id: ${{ github.run_id }}
      - name: Setup NuGet CLI
        uses: NuGet/setup-nuget@323ab0502cd38fdc493335025a96c8fdb0edc71f  # v2.0.1
      # ref: https://github.com/NuGet/setup-nuget/issues/168
      - name: Setup mono
        run: |
          sudo apt-get update -y
          sudo apt-get install --no-install-recommends -y \
            mono-devel
      - name: Create NuGet package
        run: |
          python .ci/create-nuget.py "${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}"
          nuget pack \
            $(pwd)/.ci/nuget/LightGBM.nuspec \
            -NonInteractive \
            -Verbosity detailed \
            -OutputDirectory "${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}"
      - name: Upload artifacts
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f  # v7.0.0
        with:
          name: nuget-package
          path: artifacts/*.nupkg
          if-no-files-found: error

  test-latest-versions:
    name: Python - latest versions (manylinux_2_28)
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Create wheel
        run: |
          docker run \
            --rm \
            --env CMAKE_BUILD_PARALLEL_LEVEL=${{ env.CMAKE_BUILD_PARALLEL_LEVEL }} \
            -v $(pwd):/opt/lgb-build \
            -w /opt/lgb-build \
            lightgbm/vsts-agent:manylinux_2_28_x86_64 \
            /bin/bash -c 'PATH=/opt/miniforge/bin:$PATH sh ./build-python.sh bdist_wheel --nomp'
      - name: Test compatibility
        run: |
          docker run \
            --rm \
            -v $(pwd):/opt/lgb-build \
            -w /opt/lgb-build \
            python:3.13 \
            /bin/bash ./.ci/test-python-latest.sh
  test-old-versions:
    name: Python - oldest supported versions (manylinux_2_28, Python ${{ matrix.python_version }})
    runs-on: ubuntu-latest
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        # This should always include at least the oldest
        # not-yet-end-of-life Python version
        python_version:
          - '3.9'
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Create wheel
        run: |
          docker run \
            --rm \
            --env CMAKE_BUILD_PARALLEL_LEVEL=${{ env.CMAKE_BUILD_PARALLEL_LEVEL }} \
            -v $(pwd):/opt/lgb-build \
            -w /opt/lgb-build \
            lightgbm/vsts-agent:manylinux_2_28_x86_64 \
            /bin/bash -c 'PATH=/opt/miniforge/bin:$PATH sh ./build-python.sh bdist_wheel --nomp'
      - name: Test compatibility
        run: |
          docker run \
            --rm \
            -v $(pwd):/opt/lgb-build \
            -w /opt/lgb-build \
            python:${{ matrix.python_version }} \
            /bin/bash ./.ci/test-python-oldest.sh
  all-python-package-jobs-successful:
    if: always()
    runs-on: ubuntu-latest
    needs:
      - test-latest-versions
      - test
      - test-linux-aarch64
      - test-old-versions
    steps:
      - name: Note that all tests succeeded
        uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe  # v1.2.2
        with:
          jobs: ${{ toJSON(needs) }}


================================================
FILE: .github/workflows/r_configure.yml
================================================
name: R generate configure

on:
  workflow_dispatch:
    inputs:
      pr-branch:
        type: string
        description: |
          Branch in lightgbm-org/LightGBM to update.

permissions:
  actions: none
  checks: none
  contents: write
  deployments: none
  discussions: none
  id-token: write
  issues: none
  packages: none
  pages: none
  pull-requests: read
  repository-projects: none
  security-events: none
  statuses: none

jobs:
  r-configure:
    name: r-configure
    timeout-minutes: 60
    runs-on: ubuntu-latest
    container: "ubuntu:22.04"
    steps:
      - name: Install essential software before checkout
        run: |
          apt-get update
          apt-get install --no-install-recommends -y \
            ca-certificates \
            git
      - name: Trust git cloning LightGBM
        run: |
          git config --global --add safe.directory "${GITHUB_WORKSPACE}"
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          submodules: false
          repository: lightgbm-org/LightGBM
          ref: "refs/heads/${{ inputs.pr-branch }}"
          token: ${{ github.token }}
          persist-credentials: true
      - name: Update configure
        shell: bash
        run: ./R-package/recreate-configure.sh || exit 1
      - name: Push changes
        run: |
          # source for this user and email: https://github.com/orgs/community/discussions/160496
          git config --global user.name "github-actions[bot]"
          git config --global user.email "github-actions[bot]@users.noreply.github.com"
          git add "./R-package/configure"
          git commit --allow-empty -m "Auto-update configure"
          git push


================================================
FILE: .github/workflows/r_package.yml
================================================
name: R-package

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

# automatically cancel in-progress builds if another commit is pushed
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  # tell scripts where to put artifacts
  # (this variable name is left over from when jobs ran on Azure DevOps)
  BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
  # in CMake-driven builds, parallelize compilation
  CMAKE_BUILD_PARALLEL_LEVEL: 4
  # on Debian-based images, avoid interactive prompts
  DEBIAN_FRONTEND: noninteractive
  # Fix issues like the following that can show up running 'R CMD check' on
  # specific clang versions:
  #
  #   * checking for detritus in the temp directory ... NOTE
  #   Found the following files/directories:
  #     ‘dsymutil-63923a’ ‘dsymutil-9aa721’ ‘dsymutil-b7e1bb’
  #
  # These are unlikely to show up in CRAN's checks. They come from
  # 'dsymutil ---gen-reproducer' being run (not something LightGBM explicitly does).
  #
  # ref:
  #   - https://github.com/llvm/llvm-project/issues/61920
  #   - https://github.com/golang/go/issues/59026#issuecomment-1520487072
  DSYMUTIL_REPRODUCER_PATH: /dev/null
  # parallelize compilation (extra important for Linux, where CRAN doesn't supply pre-compiled binaries)
  MAKEFLAGS: "-j4"
  # hack to get around this:
  # https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005930.html
  _R_CHECK_SYSTEM_CLOCK_: 0
  # ignore R CMD CHECK NOTE checking how long it has
  # been since the last submission
  _R_CHECK_CRAN_INCOMING_REMOTE_: 0
  # CRAN ignores the "installed size is too large" NOTE,
  # so our CI can too. Setting to a large value here just
  # to catch extreme problems
  _R_CHECK_PKG_SIZES_THRESHOLD_: 100

jobs:
  test:
    # yamllint disable-line rule:line-length
    name: ${{ matrix.task }} (${{ matrix.os-display-name || matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }})
    runs-on: ${{ matrix.os }}
    container: ${{ matrix.container }}
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        include:
          ################
          # CMake builds #
          ################
          - os: ubuntu-latest
            task: r-package
            compiler: gcc
            r_version: 4.3
            build_type: cmake
            container: 'ubuntu:22.04'
            os-display-name: 'ubuntu22.04'
          - os: ubuntu-latest
            task: r-package
            compiler: clang
            r_version: 4.3
            build_type: cmake
            container: 'ubuntu:22.04'
            os-display-name: 'ubuntu22.04'
          - os: macos-15-intel
            task: r-package
            compiler: gcc
            r_version: 4.3
            build_type: cmake
            container: null
          - os: macos-15-intel
            task: r-package
            compiler: clang
            r_version: 4.3
            build_type: cmake
            container: null
          - os: windows-latest
            task: r-package
            compiler: MINGW
            toolchain: MSYS
            r_version: 4.3
            build_type: cmake
            container: null
          # Visual Studio 2022
          - os: windows-2022
            task: r-package
            compiler: MSVC
            toolchain: MSVC
            r_version: 4.3
            build_type: cmake
            container: null
          ###############
          # CRAN builds #
          ###############
          - os: windows-latest
            task: r-package
            compiler: MINGW
            toolchain: MSYS
            r_version: 4.3
            build_type: cran
            container: null
          - os: ubuntu-latest
            task: r-package
            compiler: gcc
            r_version: 4.3
            build_type: cran
            container: 'ubuntu:22.04'
            os-display-name: 'ubuntu22.04'
            produces-artifacts: 'true'
            artifact-name: r-cran-package
          - os: macos-15-intel
            task: r-package
            compiler: clang
            r_version: 4.3
            build_type: cran
            container: null
          # macos-14 = arm64
          - os: macos-14
            task: r-package
            compiler: clang
            r_version: 4.3
            build_type: cran
            container: null
    steps:
      - name: Prevent conversion of line endings on Windows
        if: startsWith(matrix.os, 'windows')
        shell: pwsh
        run: git config --global core.autocrlf false
      - name: Install packages used by third-party actions
        if: startsWith(matrix.os, 'ubuntu')
        shell: bash
        run: |
          apt-get update -y
          apt-get install --no-install-recommends -y \
            ca-certificates \
            dirmngr \
            gpg \
            gpg-agent \
            software-properties-common \
            sudo
          # install newest version of git
          # ref:
          #     - https://unix.stackexchange.com/a/170831/550004
          #     - https://git-scm.com/download/linux
          add-apt-repository ppa:git-core/ppa -y
          apt-get update -y
          apt-get install --no-install-recommends -y \
            git
      - name: Trust git cloning LightGBM
        if: startsWith(matrix.os, 'ubuntu')
        run: |
          git config --global --add safe.directory "${GITHUB_WORKSPACE}"
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Install pandoc
        uses: r-lib/actions/setup-pandoc@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590  # v2.11.4
      - name: Install tinytex
        if: startsWith(matrix.os, 'windows')
        uses: r-lib/actions/setup-tinytex@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590  # v2.11.4
        env:
          CTAN_MIRROR: https://ctan.math.illinois.edu/systems/win32/miktex
          TINYTEX_INSTALLER: TinyTeX
      - name: Setup and run tests on Linux and macOS
        if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
        shell: bash
        run: |
          export TASK="${{ matrix.task }}"
          export COMPILER="${{ matrix.compiler }}"
          if [[ "${{ matrix.os }}" =~ ^macos ]]; then
              export OS_NAME="macos"
          elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
              export OS_NAME="linux"
              export IN_UBUNTU_BASE_CONTAINER="true"
          fi
          export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
          export LGB_VER=$(head -n 1 "${BUILD_DIRECTORY}/VERSION.txt")
          export PRODUCES_ARTIFACTS="${{ matrix.produces-artifacts }}"
          export R_VERSION="${{ matrix.r_version }}"
          export R_BUILD_TYPE="${{ matrix.build_type }}"
          $GITHUB_WORKSPACE/.ci/setup.sh
          $GITHUB_WORKSPACE/.ci/test.sh
      - name: Setup and run tests on Windows
        if: startsWith(matrix.os, 'windows')
        shell: pwsh -command ". {0}"
        run: |
          $env:BUILD_SOURCESDIRECTORY = $env:GITHUB_WORKSPACE
          $env:LGB_VER = (Get-Content -TotalCount 1 $env:BUILD_SOURCESDIRECTORY\VERSION.txt).trim().replace('rc', '-')
          $env:TOOLCHAIN = "${{ matrix.toolchain }}"
          $env:R_VERSION = "${{ matrix.r_version }}"
          $env:R_BUILD_TYPE = "${{ matrix.build_type }}"
          $env:COMPILER = "${{ matrix.compiler }}"
          $env:TASK = "${{ matrix.task }}"
          & "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1"
      - name: Upload artifacts
        if: ${{ matrix.produces-artifacts == 'true' }}
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f  # v7.0.0
        with:
          name: ${{ matrix.artifact-name }}
          path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/*.tar.gz
          if-no-files-found: error
  test-r-sanitizers:
    name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN)
    timeout-minutes: 60
    runs-on: ubuntu-latest
    container: wch1/r-debug
    strategy:
      fail-fast: false
      matrix:
        include:
          - r_customization: san
            compiler: gcc
          - r_customization: csan
            compiler: clang
    steps:
      - name: Trust git cloning LightGBM
        run: |
          git config --global --add safe.directory "${GITHUB_WORKSPACE}"
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Install packages
        shell: bash
        run: |
          RDscript${{ matrix.r_customization }} ./.ci/install-r-deps.R --build --test
          sh build-cran-package.sh --r-executable=RD${{ matrix.r_customization }}
          RD${{ matrix.r_customization }} CMD INSTALL lightgbm_*.tar.gz || exit 1
      - name: Run tests with sanitizers
        shell: bash
        run: |
          cd R-package/tests
          exit_code=0
          RDscript${{ matrix.r_customization }} testthat.R >> tests.log 2>&1 || exit_code=-1
          cat ./tests.log
          exit ${exit_code}
  test-r-extra-checks:
    name: r-package (${{ matrix.image }}, R-devel)
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        # references:
        #   * CRAN "additional checks": https://cran.r-project.org/web/checks/check_issue_kinds.html
        #   * images: https://r-hub.github.io/containers/containers.html
        image:
          - clang16
          - clang17
          - clang18
          - clang19
          - clang20
          - gcc14
          - intel
          - rchk
    runs-on: ubuntu-latest
    container: ghcr.io/r-hub/containers/${{ matrix.image }}:latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Install pandoc
        uses: r-lib/actions/setup-pandoc@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590  # v2.11.4
      - name: Install LaTeX
        shell: bash
        run: |
          if type -f apt 2>&1 > /dev/null; then
            apt-get update
            apt-get install --no-install-recommends -y \
                devscripts \
                texinfo \
                texlive-latex-extra \
                texlive-latex-recommended \
                texlive-fonts-recommended \
                texlive-fonts-extra \
                tidy \
                qpdf
          else
            yum update -y
            yum install -y \
                devscripts \
                qpdf \
                texinfo \
                texinfo-tex \
                texlive-latex \
                tidy
          fi
      - name: Install packages and run tests
        shell: bash
        run: |
          Rscript ./.ci/install-r-deps.R --build --test --exclude=testthat
          sh build-cran-package.sh

          # 'rchk' isn't run through 'R CMD check', use the approach documented at
          # https://r-hub.github.io/containers/local.html
          if [[ "${{ matrix.image }}" =~ "rchk" ]]; then
            r-check "$(pwd)" \
            | tee ./rchk-logs.txt 2>&1

            # the '-v' exceptions below are from R/rchk itself and not LightGBM:
            # https://github.com/kalibera/rchk/issues/22#issuecomment-656036156
            if grep -E '\[PB\]|ERROR' ./rchk-logs.txt \
               | grep -v 'too many states' \
               > /dev/null; \
            then
                echo "rchk found issues"
                exit 1
            else
                echo "rchk did not find any issues"
                exit 0
            fi
          fi

          # 'testthat' is not needed by 'rchk', so avoid installing it until here
          Rscript -e "install.packages('testthat', repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"

          if [[ "${{ matrix.image }}" =~ "clang" ]]; then
            # allowing the following NOTEs (produced by default in the clang images):
            #
            #   * checking compilation flags used ... NOTE
            #       Compilation used the following non-portable flag(s):
            #       ‘-Wp,-D_FORTIFY_SOURCE=3’
            #
            # even though CRAN itself sets that:
            # https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang
            #
            declare -i allowed_notes=1
          else
            declare -i allowed_notes=0
          fi

          bash .ci/run-r-cmd-check.sh \
            "$(echo lightgbm_$(head -1 VERSION.txt).tar.gz)" \
            "${allowed_notes}"
  all-r-package-jobs-successful:
    if: always()
    runs-on: ubuntu-latest
    needs: [test, test-r-sanitizers, test-r-extra-checks]
    steps:
      - name: Note that all tests succeeded
        uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe  # v1.2.2
        with:
          jobs: ${{ toJSON(needs) }}


================================================
FILE: .github/workflows/r_valgrind.yml
================================================
name: R valgrind tests

# 'run-name' is used here to distinguish in the API between different runs from forks.
#
# When this was added, it was the only way to feed workflow inputs into something that
# would show up in the output of 'gh run list'.
#
# See https://github.com/orgs/community/discussions/73223#discussioncomment-11862624
run-name: R valgrind tests (pr=${{ inputs.pr-number }})

on:
  workflow_dispatch:
    inputs:
      pr-branch:
        type: string
        description: |
          Branch the PR was submitted from.
          Branches from forks should be prefixed with the user/org they originate from,
          like '{user}:{branch}'.
      pr-number:
        type: string
        description: Pull request ID, found in the PR URL.

permissions:
  actions: write
  checks: write
  contents: read
  deployments: none
  discussions: none
  id-token: write
  issues: none
  packages: none
  pages: none
  pull-requests: write
  repository-projects: none
  security-events: none
  statuses: write

jobs:
  test-r-valgrind:
    name: r-package (ubuntu-latest, R-devel, valgrind)
    timeout-minutes: 360
    runs-on: ubuntu-latest
    container: wch1/r-debug
    env:
      GITHUB_TOKEN: ${{ github.token }}
    steps:
      - name: Install essential software before checkout
        shell: bash
        run: |
          apt-get update
          apt-get install --no-install-recommends -y \
            curl \
            jq
      - name: Install GitHub CLI
        run: |
          GH_CLI_VERSION="2.83.0"
          curl \
            --fail \
            -O \
            -L \
            https://github.com/cli/cli/releases/download/v${GH_CLI_VERSION}/gh_${GH_CLI_VERSION}_linux_amd64.tar.gz
          tar -xvf ./gh_${GH_CLI_VERSION}_linux_amd64.tar.gz
          mv ./gh_${GH_CLI_VERSION}_linux_amd64/bin/gh /usr/local/bin/
      - name: Trust git cloning LightGBM
        run: |
          git config --global --add safe.directory "${GITHUB_WORKSPACE}"
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          submodules: true
          persist-credentials: false
          repository: lightgbm-org/LightGBM
          ref: "refs/pull/${{ inputs.pr-number }}/merge"
      - name: Run tests with valgrind
        shell: bash
        run: ./.ci/test-r-package-valgrind.sh
      - name: Send final status
        if: ${{ always() }}
        run: |
          $GITHUB_WORKSPACE/.ci/set-commit-status.sh \
            "${{ github.workflow }}" \
            "${{ job.status }}" \
            "${{ github.sha }}"
          comment="Workflow **${{ github.workflow }}** has been triggered! 🚀\r\n"
          comment="${comment}\r\n${GITHUB_SERVER_URL}/lightgbm-org/LightGBM/actions/runs/${GITHUB_RUN_ID} \r\n"
          comment="${comment}\r\nStatus: ${{ job.status }}"
          $GITHUB_WORKSPACE/.ci/append-comment.sh \
            "${{ inputs.pr-number }}" \
            "${comment}"
      - name: Rerun workflow-indicator
        if: ${{ always() }}
        run: |
          bash $GITHUB_WORKSPACE/.ci/rerun-workflow.sh \
            "optional_checks.yml" \
            "${{ inputs.pr-branch }}" \
            || true


================================================
FILE: .github/workflows/release_drafter.yml
================================================
name: Release Drafter

permissions:
  contents: read

on:
  push:
    branches:
      - master

jobs:
  updateReleaseDraft:
    permissions:
      contents: write
      pull-requests: read
    runs-on: ubuntu-latest
    steps:
      - uses: release-drafter/release-drafter@6a93d829887aa2e0748befe2e808c66c0ec6e4c7  # v6.4.0
        with:
          config-name: release-drafter.yml
          disable-autolabeler: true
        env:
          GITHUB_TOKEN: ${{ github.token }}


================================================
FILE: .github/workflows/static_analysis.yml
================================================
# contains non-functional tests, like checks on docs
# and code style
name: Static Analysis

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

# automatically cancel in-progress builds if another commit is pushed
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  COMPILER: 'gcc'
  MAKEFLAGS: '-j4'
  OS_NAME: 'linux'

jobs:
  lint:
    name: lint
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: false
      - name: Setup and run tests
        shell: bash
        run: |
          export TASK=lint
          export CONDA=${HOME}/miniforge
          export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH}
          $GITHUB_WORKSPACE/.ci/setup.sh || exit 1
          $GITHUB_WORKSPACE/.ci/lint-all.sh || exit 1
  check-docs:
    name: check-docs
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: false
      - name: Setup and run tests
        shell: bash
        run: |
          export TASK=check-docs
          export CONDA=${HOME}/miniforge
          export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH}
          $GITHUB_WORKSPACE/.ci/setup.sh || exit 1
          $GITHUB_WORKSPACE/.ci/build-docs.sh || exit 1
  r-check-docs:
    name: r-package-check-docs
    timeout-minutes: 60
    runs-on: ubuntu-latest
    container: rocker/verse
    steps:
      - name: Trust git cloning LightGBM
        run: |
          git config --global --add safe.directory "${GITHUB_WORKSPACE}"
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Install packages
        shell: bash
        run: |
          Rscript ./.ci/install-r-deps.R --build --include=roxygen2
          sh build-cran-package.sh || exit 1
          R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1
      - name: Test documentation
        shell: bash --noprofile --norc {0}
        run: |
          Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1
          num_doc_files_changed=$(
              git diff --name-only | grep --count -E "\.Rd|NAMESPACE"
          )
          if [[ ${num_doc_files_changed} -gt 0 ]]; then
              echo "Some R documentation files have changed. Please re-generate them and commit those changes."
              echo ""
              echo "    sh build-cran-package.sh"
              echo "    R CMD INSTALL --with-keep.source lightgbm_*.tar.gz"
              echo "    Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\""
              echo ""
              exit 1
          fi
  all-static-analysis-jobs-successful:
    if: always()
    runs-on: ubuntu-latest
    needs: [lint, check-docs, r-check-docs]
    steps:
      - name: Note that all tests succeeded
        uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe  # v1.2.2
        with:
          jobs: ${{ toJSON(needs) }}


================================================
FILE: .github/workflows/swig.yml
================================================
name: SWIG

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

# automatically cancel in-progress builds if another commit is pushed
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  # tell scripts where to put artifacts
  # (this variable name is left over from when jobs ran on Azure DevOps)
  BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
  # in CMake-driven builds, parallelize compilation
  CMAKE_BUILD_PARALLEL_LEVEL: 4
  # all SWIG jobs produce artifacts
  PRODUCES_ARTIFACTS: 'true'
  # all jobs here have the same 'TASK'
  TASK: swig

jobs:
  test-swig:
    name: swig (${{ matrix.os-display-name || matrix.os }}, ${{ matrix.compiler }})
    runs-on: ${{ matrix.os }}
    container: ${{ matrix.container }}
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            compiler: gcc
            container: 'lightgbm.azurecr.io/vsts-agent:manylinux_2_28_x86_64'
            artifact-name: swig-linux-x86_64-jar
            os-display-name: 'manylinux_2_28'
          - os: macos-15-intel
            compiler: clang
            container: null
            artifact-name: swig-macos-x86_64-jar
          # Visual Studio 2022
          - os: windows-2022
            compiler: msvc
            container: null
            artifact-name: swig-windows-x86_64-jar
    steps:
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          fetch-depth: 5
          persist-credentials: false
          submodules: true
      - name: Setup and run tests on Linux and macOS
        if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
        shell: bash
        run: |
          export BUILD_DIRECTORY="${GITHUB_WORKSPACE}"
          export COMPILER="${{ matrix.compiler }}"
          export CONDA="${HOME}/miniforge"
          export PATH=${CONDA}/bin:${PATH}
          if [[ "${{ matrix.os }}" =~ ^macos ]]; then
              export OS_NAME="macos"
          elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
              export OS_NAME="linux"
          fi
          $GITHUB_WORKSPACE/.ci/setup.sh
          $GITHUB_WORKSPACE/.ci/test.sh
      - name: Setup and run tests on Windows
        if: startsWith(matrix.os, 'windows')
        shell: pwsh -command ". {0}"
        run: |
          $env:BUILD_DIRECTORY = $env:GITHUB_WORKSPACE
          $env:BUILD_SOURCESDIRECTORY = $env:BUILD_DIRECTORY
          & "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1"
      - name: Upload artifacts
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f  # v7.0.0
        with:
          name: ${{ matrix.artifact-name }}
          path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/*.jar
          if-no-files-found: error
  all-swig-jobs-successful:
    if: always()
    runs-on: ubuntu-latest
    needs:
      - test-swig
    steps:
      - name: Note that all tests succeeded
        uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe  # v1.2.2
        with:
          jobs: ${{ toJSON(needs) }}


================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Bb]uild/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
nuget/
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Microsoft Azure ApplicationInsights config file
ApplicationInsights.config

# Windows Store app package directory
AppPackages/
BundleArtifacts/

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
~$*
*~
.*.swp
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe

# FAKE - F# Make
.fake/


# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
/windows/LightGBM.VC.db
/lightgbm
/testlightgbm

# Created by https://www.gitignore.io/api/python

### Python ###
!/python-package/lightgbm/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
prof/
*.prof
coverage.xml
*.cover
*.py.cover
.hypothesis/
.pytest_cache/
cover/
**/coverage.html
**/coverage.html.zip
**/Rplots.pdf

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/pythonapi/
*.flag

# Doxygen documentation
docs/doxyoutput/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints
Untitled*.ipynb

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# R testing artefact
lightgbm.model

# saved or dumped model/data
*.model
*.pkl
*.bin
*.h5

# macOS
**/.DS_Store

# VSCode
.vscode

# IntelliJ/CLion
.idea
*.iml
/cmake-build-debug/

# Files from local Python install
lightgbm-python/
python-package/LICENSE
python-package/build_cpp/
python-package/compile/
python-package/lightgbm/VERSION.txt

# R build artefacts
**/autom4te.cache/
R-package/conftest*
R-package/config.status
!R-package/data/agaricus.test.rda
!R-package/data/agaricus.train.rda
!R-package/data/bank.rda
R-package/docs
R-package/src/CMakeLists.txt
R-package/src/Makevars
R-package/src/lib_lightgbm.so.dSYM/
R-package/src/src/
R-package/src-x64
R-package/src-i386
R-package/**/VERSION.txt
**/Makevars.win
lightgbm_r/*
lightgbm*.tar.gz
lightgbm*.tgz
lightgbm.Rcheck/
miktex*.zip
*.def

# Files created by examples and tests
*.buffer
**/lgb-Dataset.data
**/lgb.Dataset.data
**/model.txt
**/lgb-model.txt
examples/**/*.txt
tests/distributed/mlist.txt
tests/distributed/train*
tests/distributed/model*
tests/distributed/predict*


# Files from interactive R sessions
.Rproj.user
**/.Rapp.history
**/.Rhistory
*.rda
*.RData
*.rds

# Files generated by aspell
**/*.bak

# GraphViz artifacts
*.gv
*.gv.*

# Files from local Dask work
dask-worker-space/

# credentials and key material
*.env
*.pem
*.pub
*.rdp
*_rsa

# hipify-perl -inplace leaves behind *.prehip files
*.prehip

# pixi environments
.pixi

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# files created by release tasks
/release-artifacts


================================================
FILE: .gitmodules
================================================
[submodule "include/boost/compute"]
	path = external_libs/compute
	url = https://github.com/boostorg/compute
[submodule "eigen"]
	path = external_libs/eigen
	url = https://gitlab.com/libeigen/eigen.git
[submodule "external_libs/fmt"]
	path = external_libs/fmt
	url = https://github.com/fmtlib/fmt.git
[submodule "external_libs/fast_double_parser"]
	path = external_libs/fast_double_parser
	url = https://github.com/lemire/fast_double_parser.git


================================================
FILE: .pre-commit-config.yaml
================================================
# exclude files which are auto-generated by build tools
exclude: |
  (?x)^(
      build|
      external_libs|
      lightgbm-python|
      lightgbm_r|
  )$
  |R-package/configure$
  |R-package/inst/Makevars$
  |R-package/inst/Makevars.win$
  |R-package/man/.*Rd$

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: check-toml
      - id: check-xml
      - id: end-of-file-fixer
      - id: trailing-whitespace
  - repo: https://github.com/cmake-lint/cmake-lint
    rev: '1.4.3'
    hooks:
      - id: cmakelint
        args: ["--linelength=120"]
  - repo: https://github.com/cpplint/cpplint
    rev: '2.0.2'
    hooks:
      - id: cpplint
        args:
          - --root=..  # workaround to get correct header guard pattern
          - --recursive
          - --filter=-build/include_subdir,-whitespace/line_length
  - repo: local
    hooks:
      - id: check-omp-pragmas
        name: check-omp-pragmas
        entry: sh
        args:
          - .ci/check-omp-pragmas.sh
        language: system
        pass_filenames: false
  - repo: https://github.com/adrienverge/yamllint
    rev: v1.37.1
    hooks:
      - id: yamllint
        args: ["--strict"]
  - repo: local
    hooks:
      - id: regenerate-parameters
        name: regenerate-parameters
        entry: python
        args:
          - ./.ci/parameter-generator.py
        language: python
        pass_filenames: false
  - repo: https://github.com/rstcheck/rstcheck
    rev: v6.2.5
    hooks:
      - id: rstcheck
        args: ["--config", "./python-package/pyproject.toml"]
        additional_dependencies:
          - breathe>=4.36.0
          - sphinx>=8.1.3
          - sphinx_rtd_theme>=3.0.1
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.14.10
    hooks:
      - id: ruff-check
        args: ["--config", "python-package/pyproject.toml"]
        types_or: [python, jupyter]
      - id: ruff-format
        args: ["--config", "python-package/pyproject.toml"]
        types_or: [python, jupyter]
  - repo: https://github.com/biomejs/pre-commit
    rev: v2.3.10
    hooks:
      - id: biome-ci
        args:
          - --config-path=./biome.json
          - --diagnostic-level=info
          - --error-on-warnings
  - repo: https://github.com/shellcheck-py/shellcheck-py
    rev: v0.11.0.1
    hooks:
      - id: shellcheck
  - repo: https://github.com/crate-ci/typos
    rev: v1.40.0
    hooks:
      - id: typos
        args: ["--force-exclude"]
        exclude: (\.gitignore$)|(^\.editorconfig$)
  - repo: https://github.com/henryiii/validate-pyproject-schema-store
    rev: 2025.11.21
    hooks:
      - id: validate-pyproject
        files: python-package/pyproject.toml$
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.19.1
    hooks:
      - id: mypy
        args: ["--config-file", "python-package/pyproject.toml", "python-package/"]
        pass_filenames: false
        verbose: true
        additional_dependencies:
          - matplotlib>=3.9.1
          - pandas>=2.0
          - pyarrow>=17.0
          - scikit-learn>=1.5.2


================================================
FILE: .readthedocs.yaml
================================================
version: 2
build:
  os: "ubuntu-24.04"
  tools:
    python: "mambaforge-23.11"
conda:
  environment: docs/env.yml
formats:
  - pdf
sphinx:
  builder: html
  configuration: docs/conf.py
  fail_on_warning: true
submodules:
  include: all
  recursive: true


================================================
FILE: .typos.toml
================================================
default.extend-ignore-re = [
  "/Ot",
  "mis-alignment",
  "mis-spelled",
  "posix-seh-rt",
]

[default.extend-words]
MAPE = "MAPE"
datas = "datas"
indx = "indx"
interprete = "interprete"
mape = "mape"
splitted = "splitted"

[default.extend-identifiers]
ERRORs = "ERRORs"
GAM = "GAM"
ND24s = "ND24s"
WARNINGs = "WARNINGs"
fullset = "fullset"
thess = "thess"


================================================
FILE: .yamllint.yml
================================================
# default config: https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
extends: default

rules:
  document-start: disable
  line-length:
    max: 120
  truthy:
    # prevent treating GitHub Workflow "on" key as boolean value
    check-keys: false


================================================
FILE: CMakeLists.txt
================================================
option(USE_MPI "Enable MPI-based distributed learning" OFF)
option(USE_OPENMP "Enable OpenMP" ON)
option(USE_GPU "Enable GPU-accelerated training" OFF)
option(USE_SWIG "Enable SWIG to generate Java API" OFF)
option(USE_TIMETAG "Set to ON to output time costs" OFF)
option(USE_CUDA "Enable CUDA-accelerated training " OFF)
option(USE_ROCM "Enable ROCm-accelerated training " OFF)
option(USE_DEBUG "Set to ON for Debug mode" OFF)
option(USE_SANITIZER "Use sanitizer flags" OFF)
set(
  ENABLED_SANITIZERS
  "address" "leak" "undefined"
  CACHE
  STRING
  "Semicolon separated list of sanitizer names, e.g., 'address;leak'. \
Supported sanitizers are address, leak, undefined and thread."
)
option(USE_HOMEBREW_FALLBACK "(macOS-only) also look in 'brew --prefix' for libraries (e.g. OpenMP)" ON)
option(BUILD_CLI "Build the 'lightgbm' command-line interface in addition to lib_lightgbm" ON)
option(BUILD_CPP_TEST "Build C++ tests with Google Test" OFF)
option(BUILD_STATIC_LIB "Build static library" OFF)
option(INSTALL_HEADERS "Install headers to CMAKE_INSTALL_PREFIX (e.g. '/usr/local/include')" ON)
option(__BUILD_FOR_PYTHON "Set to ON if building lib_lightgbm for use with the Python-package" OFF)
option(__BUILD_FOR_R "Set to ON if building lib_lightgbm for use with the R-package" OFF)
option(__INTEGRATE_OPENCL "Set to ON if building LightGBM with the OpenCL ICD Loader and its dependencies included" OFF)

cmake_minimum_required(VERSION 3.28)

# If using Visual Studio generators, always target v10.x of the Windows SDK.
# Doing this avoids lookups that could fall back to very old versions, e.g. by finding
# outdated registry entries.
# ref: https://cmake.org/cmake/help/latest/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.html
if(CMAKE_GENERATOR MATCHES "Visual Studio")
    set(CMAKE_SYSTEM_VERSION 10.0 CACHE INTERNAL "target Windows SDK version" FORCE)
endif()

project(lightgbm LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")

#-- Sanitizer
if(USE_SANITIZER)
  if(MSVC)
    message(FATAL_ERROR "Sanitizers are not supported with MSVC.")
  endif()
  include(cmake/Sanitizer.cmake)
  enable_sanitizers("${ENABLED_SANITIZERS}")
endif()

if(__INTEGRATE_OPENCL)
  set(__INTEGRATE_OPENCL ON CACHE BOOL "" FORCE)
  set(USE_GPU OFF CACHE BOOL "" FORCE)
  message(STATUS "Building library with integrated OpenCL components")
endif()

if(__BUILD_FOR_PYTHON OR __BUILD_FOR_R OR USE_SWIG)
    # the SWIG wrapper, the Python and R packages don't require the CLI
    set(BUILD_CLI OFF)
    # installing the SWIG wrapper, the R and Python packages shouldn't place LightGBM's headers
    # outside of where the package is installed
    set(INSTALL_HEADERS OFF)
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.2")
    message(FATAL_ERROR "Insufficient gcc version (${CMAKE_CXX_COMPILER_VERSION})")
  endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.8")
    message(FATAL_ERROR "Insufficient Clang version (${CMAKE_CXX_COMPILER_VERSION})")
  endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.1.0")
    message(FATAL_ERROR "Insufficient AppleClang version (${CMAKE_CXX_COMPILER_VERSION})")
  endif()
elseif(MSVC)
  if(MSVC_VERSION LESS 1900)
    message(FATAL_ERROR "Insufficient MSVC version (${MSVC_VERSION})")
  endif()
endif()

if(USE_SWIG)
  find_package(SWIG REQUIRED)
  find_package(Java REQUIRED)
  find_package(JNI REQUIRED)
  include(UseJava)
  include(UseSWIG)
  set(SWIG_CXX_EXTENSION "cxx")
  set(SWIG_EXTRA_LIBRARIES "")
  set(SWIG_JAVA_EXTRA_FILE_EXTENSIONS ".java" "JNI.java")
  set(SWIG_MODULE_JAVA_LANGUAGE "JAVA")
  set(SWIG_MODULE_JAVA_SWIG_LANGUAGE_FLAG "java")
  set(CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/java")
  include_directories(Java_INCLUDE_DIRS)
  include_directories(JNI_INCLUDE_DIRS)
  include_directories($ENV{JAVA_HOME}/include)
  if(WIN32)
      set(LGBM_SWIG_DESTINATION_DIR "${CMAKE_CURRENT_BINARY_DIR}/com/microsoft/ml/lightgbm/windows/x86_64")
      include_directories($ENV{JAVA_HOME}/include/win32)
  elseif(APPLE)
      set(LGBM_SWIG_DESTINATION_DIR "${CMAKE_CURRENT_BINARY_DIR}/com/microsoft/ml/lightgbm/osx/x86_64")
      include_directories($ENV{JAVA_HOME}/include/darwin)
  else()
      set(LGBM_SWIG_DESTINATION_DIR "${CMAKE_CURRENT_BINARY_DIR}/com/microsoft/ml/lightgbm/linux/x86_64")
      include_directories($ENV{JAVA_HOME}/include/linux)
  endif()
  file(MAKE_DIRECTORY "${LGBM_SWIG_DESTINATION_DIR}")
endif()

set(EIGEN_DIR "${PROJECT_SOURCE_DIR}/external_libs/eigen")
include_directories(${EIGEN_DIR})

# See https://gitlab.com/libeigen/eigen/-/blob/master/COPYING.README
add_definitions(-DEIGEN_MPL2_ONLY)
add_definitions(-DEIGEN_DONT_PARALLELIZE)

set(FAST_DOUBLE_PARSER_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/external_libs/fast_double_parser/include")
include_directories(${FAST_DOUBLE_PARSER_INCLUDE_DIR})

set(FMT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/external_libs/fmt/include")
include_directories(${FMT_INCLUDE_DIR})

if(__BUILD_FOR_R)
    find_package(LibR REQUIRED)
    message(STATUS "LIBR_EXECUTABLE: ${LIBR_EXECUTABLE}")
    message(STATUS "LIBR_INCLUDE_DIRS: ${LIBR_INCLUDE_DIRS}")
    message(STATUS "LIBR_LIBS_DIR: ${LIBR_LIBS_DIR}")
    message(STATUS "LIBR_CORE_LIBRARY: ${LIBR_CORE_LIBRARY}")
    include_directories(${LIBR_INCLUDE_DIRS})
    add_definitions(-DLGB_R_BUILD)
endif()

if(USE_TIMETAG)
    add_definitions(-DTIMETAG)
endif()

if(USE_DEBUG)
    add_definitions(-DDEBUG)
endif()

if(USE_MPI)
    find_package(MPI REQUIRED)
    add_definitions(-DUSE_MPI)
else()
    add_definitions(-DUSE_SOCKET)
endif()

if(USE_CUDA)
    set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}")
    enable_language(CUDA)
    set(USE_OPENMP ON CACHE BOOL "CUDA requires OpenMP" FORCE)
endif()

if(USE_ROCM)
    enable_language(HIP)
    set(USE_OPENMP ON CACHE BOOL "ROCm requires OpenMP" FORCE)
endif()

if(USE_OPENMP)
    if(APPLE)
        find_package(OpenMP)
        if(NOT OpenMP_FOUND)
            if(USE_HOMEBREW_FALLBACK)
                # libomp 15.0+ from brew is keg-only, so have to search in other locations.
                # See https://github.com/Homebrew/homebrew-core/issues/112107#issuecomment-1278042927.
                execute_process(COMMAND brew --prefix libomp
                            OUTPUT_VARIABLE HOMEBREW_LIBOMP_PREFIX
                            OUTPUT_STRIP_TRAILING_WHITESPACE)
                set(OpenMP_C_FLAGS "-Xpreprocessor -fopenmp -I${HOMEBREW_LIBOMP_PREFIX}/include")
                set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I${HOMEBREW_LIBOMP_PREFIX}/include")
                set(OpenMP_C_LIB_NAMES omp)
                set(OpenMP_CXX_LIB_NAMES omp)
                set(OpenMP_omp_LIBRARY ${HOMEBREW_LIBOMP_PREFIX}/lib/libomp.dylib)
            endif()
            find_package(OpenMP REQUIRED)
        endif()
    else()
        find_package(OpenMP REQUIRED)
    endif()
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

if(USE_GPU)
    set(BOOST_COMPUTE_HEADER_DIR ${PROJECT_SOURCE_DIR}/external_libs/compute/include)
    include_directories(${BOOST_COMPUTE_HEADER_DIR})
    find_package(OpenCL REQUIRED)
    include_directories(${OpenCL_INCLUDE_DIRS})
    message(STATUS "OpenCL include directory: " ${OpenCL_INCLUDE_DIRS})
    if(WIN32)
        set(Boost_USE_STATIC_LIBS ON)
    endif()
    find_package(Boost 1.56.0 COMPONENTS filesystem system REQUIRED)
    if(WIN32)
        # disable autolinking in boost
        add_definitions(-DBOOST_ALL_NO_LIB)
    endif()
    include_directories(${Boost_INCLUDE_DIRS})
    add_definitions(-DUSE_GPU)
endif()

if(__INTEGRATE_OPENCL)
    if(APPLE)
        message(FATAL_ERROR "Integrated OpenCL build is not available on macOS")
    else()
        include(cmake/IntegratedOpenCL.cmake)
        add_definitions(-DUSE_GPU)
    endif()
endif()

if(BUILD_CPP_TEST AND MSVC)
  # Use /MT flag to statically link the C runtime
  set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

if(USE_CUDA)
    find_package(CUDAToolkit 11.0 REQUIRED)
    find_package(NCCL REQUIRED)
    include_directories(${CUDAToolkit_INCLUDE_DIRS})
    set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=${OpenMP_CXX_FLAGS} -Xcompiler=-fPIC -Xcompiler=-Wall")

    # reference for mapping of CUDA toolkit component versions to supported architectures ("compute capabilities"):
    # https://en.wikipedia.org/wiki/CUDA#GPUs_supported
    set(CUDA_ARCHS "60" "61" "62" "70" "75")
    if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.0")
        list(APPEND CUDA_ARCHS "80")
    endif()
    if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.1")
        list(APPEND CUDA_ARCHS "86")
    endif()
    if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.5")
        list(APPEND CUDA_ARCHS "87")
    endif()
    if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.8")
        list(APPEND CUDA_ARCHS "89")
        list(APPEND CUDA_ARCHS "90")
    endif()
    if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.8")
        list(APPEND CUDA_ARCHS "100")
        list(APPEND CUDA_ARCHS "120")
    endif()
    # Generate PTX for the most recent architecture for forwards compatibility
    list(POP_BACK CUDA_ARCHS CUDA_LAST_SUPPORTED_ARCH)
    list(TRANSFORM CUDA_ARCHS APPEND "-real")
    list(APPEND CUDA_ARCHS "${CUDA_LAST_SUPPORTED_ARCH}-real" "${CUDA_LAST_SUPPORTED_ARCH}-virtual")
    message(STATUS "CUDA_ARCHITECTURES: ${CUDA_ARCHS}")
    if(USE_DEBUG)
      set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -g")
    else()
      set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -O3 -lineinfo")
    endif()
    message(STATUS "CMAKE_CUDA_FLAGS: ${CMAKE_CUDA_FLAGS}")

    add_definitions(-DUSE_CUDA)

    if(NOT DEFINED CMAKE_CUDA_STANDARD)
      set(CMAKE_CUDA_STANDARD 17)
      set(CMAKE_CUDA_STANDARD_REQUIRED ON)
    endif()
endif()

if(USE_ROCM)
    find_package(HIP)
    include_directories(${HIP_INCLUDE_DIRS})
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__HIP_PLATFORM_AMD__")
    set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} ${OpenMP_CXX_FLAGS} -fPIC -Wall")

    # avoid warning: unused variable 'mask' due to __shfl_down_sync work-around
    set(DISABLED_WARNINGS "${DISABLED_WARNINGS} -Wno-unused-variable")
    # avoid warning: 'hipHostAlloc' is deprecated: use hipHostMalloc instead
    set(DISABLED_WARNINGS "${DISABLED_WARNINGS} -Wno-deprecated-declarations")
    # avoid many warnings about missing overrides
    set(DISABLED_WARNINGS "${DISABLED_WARNINGS} -Wno-inconsistent-missing-override")
    # avoid warning: shift count >= width of type in feature_histogram.hpp
    set(DISABLED_WARNINGS "${DISABLED_WARNINGS} -Wno-shift-count-overflow")

    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DISABLED_WARNINGS}")
    set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} ${DISABLED_WARNINGS}")

    if(USE_DEBUG)
      set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -g -O0")
    else()
      set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -O3")
    endif()
    message(STATUS "CMAKE_HIP_FLAGS: ${CMAKE_HIP_FLAGS}")

    # Building for ROCm almost always means USE_CUDA.
    # Exceptions to this will be guarded by USE_ROCM.
    add_definitions(-DUSE_CUDA)
    add_definitions(-DUSE_ROCM)
endif()

include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <xmmintrin.h>
int main() {
  int a = 0;
  _mm_prefetch(&a, _MM_HINT_NTA);
  return 0;
}
" MM_PREFETCH)

if(${MM_PREFETCH})
  message(STATUS "Using _mm_prefetch")
  add_definitions(-DMM_PREFETCH)
endif()

include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <mm_malloc.h>
int main() {
  char *a = (char*)_mm_malloc(8, 16);
  _mm_free(a);
  return 0;
}
" MM_MALLOC)

if(${MM_MALLOC})
  message(STATUS "Using _mm_malloc")
  add_definitions(-DMM_MALLOC)
endif()

if(UNIX OR MINGW OR CYGWIN)
  set(
    CMAKE_CXX_FLAGS
    "${CMAKE_CXX_FLAGS} -pthread -Wextra -Wall -Wno-ignored-attributes -Wno-unknown-pragmas -Wno-return-type"
  )
  if(MINGW)
    # ignore this warning: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95353
    set(
      CMAKE_CXX_FLAGS
      "${CMAKE_CXX_FLAGS} -Wno-stringop-overflow"
    )
  endif()
  if(USE_DEBUG)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
  else()
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
  endif()
  if(USE_SWIG)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
  endif()
  if(NOT USE_OPENMP)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas -Wno-unused-private-field")
  endif()
  if(__BUILD_FOR_R AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cast-function-type")
  endif()
endif()

if(WIN32 AND MINGW)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
endif()

# Check if inet_pton is already available, to avoid conflicts with the implementation in LightGBM.
# As of 2022, MinGW started including a definition of inet_pton.
if(WIN32)
  include(CheckSymbolExists)
  list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32")
  check_symbol_exists(inet_pton "ws2tcpip.h" WIN_INET_PTON_FOUND)
  if(WIN_INET_PTON_FOUND)
    add_definitions(-DWIN_HAS_INET_PTON)
  endif()
  list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "ws2_32")
endif()

if(MSVC)
    # compiling 'fmt' on MSVC: "Unicode support requires compiling with /utf-8"
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP /utf-8")
    if(__BUILD_FOR_R)
        # MSVC does not like this commit:
        # https://github.com/wch/r-source/commit/fb52ac1a610571fcb8ac92d886b9fefcffaa7d48
        #
        # and raises "error C3646: 'private_data_c': unknown override specifier"
        add_definitions(-DR_LEGACY_RCOMPLEX)
    endif()
    if(USE_DEBUG)
        set(CMAKE_CXX_FLAGS "${CMAKE_C
Download .txt
gitextract_uh184o35/

├── .appveyor.yml
├── .ci/
│   ├── README.md
│   ├── append-comment.sh
│   ├── build-docs.sh
│   ├── check-dynamic-dependencies.sh
│   ├── check-omp-pragmas.sh
│   ├── check-python-dists.sh
│   ├── check-workflow-status.sh
│   ├── conda-envs/
│   │   ├── README.md
│   │   ├── ci-core-py39.txt
│   │   └── ci-core.txt
│   ├── create-nuget.py
│   ├── download-artifacts.sh
│   ├── install-opencl.ps1
│   ├── install-r-deps.R
│   ├── lint-all.sh
│   ├── lint-powershell.ps1
│   ├── lint-r-code.R
│   ├── parameter-generator.py
│   ├── pip-envs/
│   │   ├── requirements-latest.txt
│   │   └── requirements-oldest.txt
│   ├── rerun-workflow.sh
│   ├── run-r-cmd-check.sh
│   ├── set-commit-status.sh
│   ├── setup.sh
│   ├── test-python-latest.sh
│   ├── test-python-oldest.sh
│   ├── test-r-package-valgrind.sh
│   ├── test-r-package-windows.ps1
│   ├── test-r-package.sh
│   ├── test-windows.ps1
│   └── test.sh
├── .editorconfig
├── .git-blame-ignore-revs
├── .github/
│   ├── CODEOWNERS
│   ├── ISSUE_TEMPLATE/
│   │   ├── BUG_REPORT.md
│   │   └── FEATURE_REQUEST.md
│   ├── dependabot.yml
│   ├── release-drafter.yml
│   └── workflows/
│       ├── build.yml
│       ├── cpp.yml
│       ├── cuda.yml
│       ├── lock.yml
│       ├── lychee.yml
│       ├── no_response.yml
│       ├── optional_checks.yml
│       ├── python_package.yml
│       ├── r_configure.yml
│       ├── r_package.yml
│       ├── r_valgrind.yml
│       ├── release_drafter.yml
│       ├── static_analysis.yml
│       └── swig.yml
├── .gitignore
├── .gitmodules
├── .pre-commit-config.yaml
├── .readthedocs.yaml
├── .typos.toml
├── .yamllint.yml
├── CMakeLists.txt
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── MAINTAINING.md
├── R-package/
│   ├── .Rbuildignore
│   ├── AUTOCONF_UBUNTU_VERSION
│   ├── DESCRIPTION
│   ├── LICENSE
│   ├── NAMESPACE
│   ├── R/
│   │   ├── aliases.R
│   │   ├── callback.R
│   │   ├── lgb.Booster.R
│   │   ├── lgb.DataProcessor.R
│   │   ├── lgb.Dataset.R
│   │   ├── lgb.Predictor.R
│   │   ├── lgb.convert_with_rules.R
│   │   ├── lgb.cv.R
│   │   ├── lgb.drop_serialized.R
│   │   ├── lgb.importance.R
│   │   ├── lgb.interprete.R
│   │   ├── lgb.make_serializable.R
│   │   ├── lgb.model.dt.tree.R
│   │   ├── lgb.plot.importance.R
│   │   ├── lgb.plot.interpretation.R
│   │   ├── lgb.restore_handle.R
│   │   ├── lgb.train.R
│   │   ├── lightgbm.R
│   │   ├── metrics.R
│   │   ├── multithreading.R
│   │   └── utils.R
│   ├── README.md
│   ├── cleanup
│   ├── configure
│   ├── configure.ac
│   ├── configure.win
│   ├── cran-comments.md
│   ├── demo/
│   │   ├── 00Index
│   │   ├── basic_walkthrough.R
│   │   ├── boost_from_prediction.R
│   │   ├── categorical_features_rules.R
│   │   ├── cross_validation.R
│   │   ├── early_stopping.R
│   │   ├── efficient_many_training.R
│   │   ├── leaf_stability.R
│   │   ├── multiclass.R
│   │   ├── multiclass_custom_objective.R
│   │   └── weight_param.R
│   ├── inst/
│   │   ├── Makevars
│   │   └── make-r-def.R
│   ├── man/
│   │   ├── agaricus.test.Rd
│   │   ├── agaricus.train.Rd
│   │   ├── bank.Rd
│   │   ├── dim.Rd
│   │   ├── dimnames.lgb.Dataset.Rd
│   │   ├── getLGBMThreads.Rd
│   │   ├── get_field.Rd
│   │   ├── lgb.Dataset.Rd
│   │   ├── lgb.Dataset.construct.Rd
│   │   ├── lgb.Dataset.create.valid.Rd
│   │   ├── lgb.Dataset.save.Rd
│   │   ├── lgb.Dataset.set.categorical.Rd
│   │   ├── lgb.Dataset.set.reference.Rd
│   │   ├── lgb.configure_fast_predict.Rd
│   │   ├── lgb.convert_with_rules.Rd
│   │   ├── lgb.cv.Rd
│   │   ├── lgb.drop_serialized.Rd
│   │   ├── lgb.dump.Rd
│   │   ├── lgb.get.eval.result.Rd
│   │   ├── lgb.importance.Rd
│   │   ├── lgb.interprete.Rd
│   │   ├── lgb.load.Rd
│   │   ├── lgb.make_serializable.Rd
│   │   ├── lgb.model.dt.tree.Rd
│   │   ├── lgb.plot.importance.Rd
│   │   ├── lgb.plot.interpretation.Rd
│   │   ├── lgb.restore_handle.Rd
│   │   ├── lgb.save.Rd
│   │   ├── lgb.slice.Dataset.Rd
│   │   ├── lgb.train.Rd
│   │   ├── lgb_predict_shared_params.Rd
│   │   ├── lgb_shared_dataset_params.Rd
│   │   ├── lgb_shared_params.Rd
│   │   ├── lightgbm.Rd
│   │   ├── predict.lgb.Booster.Rd
│   │   ├── print.lgb.Booster.Rd
│   │   ├── setLGBMThreads.Rd
│   │   ├── set_field.Rd
│   │   └── summary.lgb.Booster.Rd
│   ├── pkgdown/
│   │   └── _pkgdown.yml
│   ├── recreate-configure.sh
│   ├── src/
│   │   ├── Makevars.in
│   │   ├── Makevars.win.in
│   │   ├── install.libs.R
│   │   ├── lightgbm_R.cpp
│   │   └── lightgbm_R.h
│   ├── tests/
│   │   ├── testthat/
│   │   │   ├── helper.R
│   │   │   ├── test_Predictor.R
│   │   │   ├── test_basic.R
│   │   │   ├── test_custom_objective.R
│   │   │   ├── test_dataset.R
│   │   │   ├── test_learning_to_rank.R
│   │   │   ├── test_lgb.Booster.R
│   │   │   ├── test_lgb.convert_with_rules.R
│   │   │   ├── test_lgb.importance.R
│   │   │   ├── test_lgb.interprete.R
│   │   │   ├── test_lgb.model.dt.tree.R
│   │   │   ├── test_lgb.plot.importance.R
│   │   │   ├── test_lgb.plot.interpretation.R
│   │   │   ├── test_metrics.R
│   │   │   ├── test_multithreading.R
│   │   │   ├── test_parameters.R
│   │   │   ├── test_utils.R
│   │   │   └── test_weighted_loss.R
│   │   └── testthat.R
│   └── vignettes/
│       └── basic_walkthrough.Rmd
├── README.md
├── SECURITY.md
├── VERSION.txt
├── biome.json
├── build-cran-package.sh
├── build-python.sh
├── build_r.R
├── cmake/
│   ├── IntegratedOpenCL.cmake
│   ├── Sanitizer.cmake
│   └── modules/
│       ├── FindLibR.cmake
│       └── FindNCCL.cmake
├── docker/
│   ├── README.md
│   ├── dockerfile-cli
│   ├── dockerfile-python
│   ├── dockerfile-r
│   └── gpu/
│       ├── README.md
│       ├── dockerfile-cli-only-distroless.gpu
│       ├── dockerfile-cli-only.gpu
│       └── dockerfile.gpu
├── docs/
│   ├── .lychee.toml
│   ├── Advanced-Topics.rst
│   ├── C-API.rst
│   ├── Development-Guide.rst
│   ├── Experiments.rst
│   ├── FAQ.rst
│   ├── Features.rst
│   ├── GPU-Performance.rst
│   ├── GPU-Targets.rst
│   ├── GPU-Tutorial.rst
│   ├── GPU-Windows.rst
│   ├── Installation-Guide.rst
│   ├── Key-Events.md
│   ├── Makefile
│   ├── Parallel-Learning-Guide.rst
│   ├── Parameters-Tuning.rst
│   ├── Parameters.rst
│   ├── Python-API.rst
│   ├── Python-Intro.rst
│   ├── Quick-Start.rst
│   ├── README.rst
│   ├── _static/
│   │   └── js/
│   │       └── script.js
│   ├── build-docs.sh
│   ├── conf.py
│   ├── env.yml
│   ├── gcc-Tips.rst
│   ├── index.rst
│   ├── logo/
│   │   ├── LightGBM-logo-hex.cdr
│   │   └── LightGBM_logo.cdr
│   └── make.bat
├── examples/
│   ├── README.md
│   ├── binary_classification/
│   │   ├── README.md
│   │   ├── binary.test
│   │   ├── binary.test.weight
│   │   ├── binary.train
│   │   ├── binary.train.weight
│   │   ├── forced_splits.json
│   │   ├── predict.conf
│   │   ├── train.conf
│   │   └── train_linear.conf
│   ├── lambdarank/
│   │   ├── README.md
│   │   ├── predict.conf
│   │   ├── rank.test
│   │   ├── rank.test.query
│   │   ├── rank.train
│   │   ├── rank.train.query
│   │   └── train.conf
│   ├── multiclass_classification/
│   │   ├── README.md
│   │   ├── multiclass.test
│   │   ├── multiclass.train
│   │   ├── predict.conf
│   │   └── train.conf
│   ├── parallel_learning/
│   │   ├── README.md
│   │   ├── binary.test
│   │   ├── binary.train
│   │   ├── predict.conf
│   │   └── train.conf
│   ├── python-guide/
│   │   ├── README.md
│   │   ├── advanced_example.py
│   │   ├── dask/
│   │   │   ├── README.md
│   │   │   ├── binary-classification.py
│   │   │   ├── multiclass-classification.py
│   │   │   ├── prediction.py
│   │   │   ├── ranking.py
│   │   │   └── regression.py
│   │   ├── dataset_from_multi_hdf5.py
│   │   ├── logistic_regression.py
│   │   ├── notebooks/
│   │   │   └── interactive_plot_example.ipynb
│   │   ├── plot_example.py
│   │   ├── simple_example.py
│   │   └── sklearn_example.py
│   ├── regression/
│   │   ├── README.md
│   │   ├── forced_bins.json
│   │   ├── forced_bins2.json
│   │   ├── predict.conf
│   │   ├── regression.test
│   │   ├── regression.test.init
│   │   ├── regression.train
│   │   ├── regression.train.init
│   │   └── train.conf
│   └── xendcg/
│       ├── README.md
│       ├── predict.conf
│       ├── rank.test
│       ├── rank.test.query
│       ├── rank.train
│       ├── rank.train.query
│       └── train.conf
├── include/
│   └── LightGBM/
│       ├── application.h
│       ├── arrow.h
│       ├── arrow.tpp
│       ├── bin.h
│       ├── boosting.h
│       ├── c_api.h
│       ├── config.h
│       ├── cuda/
│       │   ├── cuda_algorithms.hpp
│       │   ├── cuda_column_data.hpp
│       │   ├── cuda_metadata.hpp
│       │   ├── cuda_metric.hpp
│       │   ├── cuda_nccl_topology.hpp
│       │   ├── cuda_objective_function.hpp
│       │   ├── cuda_random.hpp
│       │   ├── cuda_rocm_interop.h
│       │   ├── cuda_row_data.hpp
│       │   ├── cuda_split_info.hpp
│       │   ├── cuda_tree.hpp
│       │   ├── cuda_utils.hu
│       │   └── vector_cudahost.h
│       ├── dataset.h
│       ├── dataset_loader.h
│       ├── export.h
│       ├── feature_group.h
│       ├── meta.h
│       ├── metric.h
│       ├── network.h
│       ├── objective_function.h
│       ├── prediction_early_stop.h
│       ├── sample_strategy.h
│       ├── train_share_states.h
│       ├── tree.h
│       ├── tree_learner.h
│       └── utils/
│           ├── array_args.h
│           ├── binary_writer.h
│           ├── byte_buffer.h
│           ├── chunked_array.hpp
│           ├── common.h
│           ├── file_io.h
│           ├── json11.h
│           ├── log.h
│           ├── openmp_wrapper.h
│           ├── pipeline_reader.h
│           ├── random.h
│           ├── text_reader.h
│           ├── threading.h
│           └── yamc/
│               ├── alternate_shared_mutex.hpp
│               ├── yamc_rwlock_sched.hpp
│               └── yamc_shared_lock.hpp
├── python-package/
│   ├── README.rst
│   ├── lightgbm/
│   │   ├── __init__.py
│   │   ├── basic.py
│   │   ├── callback.py
│   │   ├── compat.py
│   │   ├── dask.py
│   │   ├── engine.py
│   │   ├── libpath.py
│   │   ├── plotting.py
│   │   ├── py.typed
│   │   └── sklearn.py
│   └── pyproject.toml
├── src/
│   ├── application/
│   │   ├── application.cpp
│   │   └── predictor.hpp
│   ├── boosting/
│   │   ├── bagging.hpp
│   │   ├── boosting.cpp
│   │   ├── cuda/
│   │   │   ├── cuda_score_updater.cpp
│   │   │   ├── cuda_score_updater.cu
│   │   │   ├── cuda_score_updater.hpp
│   │   │   ├── nccl_gbdt.cpp
│   │   │   ├── nccl_gbdt.hpp
│   │   │   └── nccl_gbdt_component.hpp
│   │   ├── dart.hpp
│   │   ├── gbdt.cpp
│   │   ├── gbdt.h
│   │   ├── gbdt_model_text.cpp
│   │   ├── gbdt_prediction.cpp
│   │   ├── goss.hpp
│   │   ├── prediction_early_stop.cpp
│   │   ├── rf.hpp
│   │   ├── sample_strategy.cpp
│   │   └── score_updater.hpp
│   ├── c_api.cpp
│   ├── cuda/
│   │   ├── cuda_algorithms.cu
│   │   └── cuda_utils.cpp
│   ├── io/
│   │   ├── bin.cpp
│   │   ├── config.cpp
│   │   ├── config_auto.cpp
│   │   ├── cuda/
│   │   │   ├── cuda_column_data.cpp
│   │   │   ├── cuda_column_data.cu
│   │   │   ├── cuda_metadata.cpp
│   │   │   ├── cuda_row_data.cpp
│   │   │   ├── cuda_tree.cpp
│   │   │   └── cuda_tree.cu
│   │   ├── dataset.cpp
│   │   ├── dataset_loader.cpp
│   │   ├── dense_bin.hpp
│   │   ├── file_io.cpp
│   │   ├── json11.cpp
│   │   ├── metadata.cpp
│   │   ├── multi_val_dense_bin.hpp
│   │   ├── multi_val_sparse_bin.hpp
│   │   ├── parser.cpp
│   │   ├── parser.hpp
│   │   ├── sparse_bin.hpp
│   │   ├── train_share_states.cpp
│   │   └── tree.cpp
│   ├── main.cpp
│   ├── metric/
│   │   ├── binary_metric.hpp
│   │   ├── cuda/
│   │   │   ├── cuda_binary_metric.cpp
│   │   │   ├── cuda_binary_metric.hpp
│   │   │   ├── cuda_pointwise_metric.cpp
│   │   │   ├── cuda_pointwise_metric.cu
│   │   │   ├── cuda_pointwise_metric.hpp
│   │   │   ├── cuda_regression_metric.cpp
│   │   │   └── cuda_regression_metric.hpp
│   │   ├── dcg_calculator.cpp
│   │   ├── map_metric.hpp
│   │   ├── metric.cpp
│   │   ├── multiclass_metric.hpp
│   │   ├── rank_metric.hpp
│   │   ├── regression_metric.hpp
│   │   └── xentropy_metric.hpp
│   ├── network/
│   │   ├── linker_topo.cpp
│   │   ├── linkers.h
│   │   ├── linkers_mpi.cpp
│   │   ├── linkers_socket.cpp
│   │   ├── network.cpp
│   │   └── socket_wrapper.hpp
│   ├── objective/
│   │   ├── binary_objective.hpp
│   │   ├── cuda/
│   │   │   ├── cuda_binary_objective.cpp
│   │   │   ├── cuda_binary_objective.cu
│   │   │   ├── cuda_binary_objective.hpp
│   │   │   ├── cuda_multiclass_objective.cpp
│   │   │   ├── cuda_multiclass_objective.cu
│   │   │   ├── cuda_multiclass_objective.hpp
│   │   │   ├── cuda_rank_objective.cpp
│   │   │   ├── cuda_rank_objective.cu
│   │   │   ├── cuda_rank_objective.hpp
│   │   │   ├── cuda_regression_objective.cpp
│   │   │   ├── cuda_regression_objective.cu
│   │   │   └── cuda_regression_objective.hpp
│   │   ├── multiclass_objective.hpp
│   │   ├── objective_function.cpp
│   │   ├── rank_objective.hpp
│   │   ├── regression_objective.hpp
│   │   └── xentropy_objective.hpp
│   ├── treelearner/
│   │   ├── col_sampler.hpp
│   │   ├── cost_effective_gradient_boosting.hpp
│   │   ├── cuda/
│   │   │   ├── cuda_best_split_finder.cpp
│   │   │   ├── cuda_best_split_finder.cu
│   │   │   ├── cuda_best_split_finder.hpp
│   │   │   ├── cuda_data_partition.cpp
│   │   │   ├── cuda_data_partition.cu
│   │   │   ├── cuda_data_partition.hpp
│   │   │   ├── cuda_gradient_discretizer.cu
│   │   │   ├── cuda_gradient_discretizer.hpp
│   │   │   ├── cuda_histogram_constructor.cpp
│   │   │   ├── cuda_histogram_constructor.cu
│   │   │   ├── cuda_histogram_constructor.hpp
│   │   │   ├── cuda_leaf_splits.cpp
│   │   │   ├── cuda_leaf_splits.cu
│   │   │   ├── cuda_leaf_splits.hpp
│   │   │   ├── cuda_single_gpu_tree_learner.cpp
│   │   │   ├── cuda_single_gpu_tree_learner.cu
│   │   │   └── cuda_single_gpu_tree_learner.hpp
│   │   ├── data_parallel_tree_learner.cpp
│   │   ├── data_partition.hpp
│   │   ├── feature_histogram.cpp
│   │   ├── feature_histogram.hpp
│   │   ├── feature_parallel_tree_learner.cpp
│   │   ├── gpu_tree_learner.cpp
│   │   ├── gpu_tree_learner.h
│   │   ├── gradient_discretizer.cpp
│   │   ├── gradient_discretizer.hpp
│   │   ├── leaf_splits.hpp
│   │   ├── linear_tree_learner.cpp
│   │   ├── linear_tree_learner.h
│   │   ├── monotone_constraints.hpp
│   │   ├── ocl/
│   │   │   ├── histogram16.cl
│   │   │   ├── histogram256.cl
│   │   │   └── histogram64.cl
│   │   ├── parallel_tree_learner.h
│   │   ├── serial_tree_learner.cpp
│   │   ├── serial_tree_learner.h
│   │   ├── split_info.hpp
│   │   ├── tree_learner.cpp
│   │   └── voting_parallel_tree_learner.cpp
│   └── utils/
│       └── openmp_wrapper.cpp
├── swig/
│   ├── ChunkedArray_API_extensions.i
│   ├── StringArray.hpp
│   ├── StringArray.i
│   ├── StringArray_API_extensions.i
│   ├── lightgbmlib.i
│   └── pointer_manipulation.i
├── tests/
│   ├── c_api_test/
│   │   └── test_.py
│   ├── cpp_tests/
│   │   ├── predict.conf
│   │   ├── test.py
│   │   ├── test_array_args.cpp
│   │   ├── test_arrow.cpp
│   │   ├── test_byte_buffer.cpp
│   │   ├── test_chunked_array.cpp
│   │   ├── test_common.cpp
│   │   ├── test_main.cpp
│   │   ├── test_serialize.cpp
│   │   ├── test_single_row.cpp
│   │   ├── test_stream.cpp
│   │   ├── testutils.cpp
│   │   ├── testutils.h
│   │   └── train.conf
│   ├── data/
│   │   └── categorical.data
│   ├── distributed/
│   │   ├── _test_distributed.py
│   │   └── conftest.py
│   └── python_package_test/
│       ├── __init__.py
│       ├── conftest.py
│       ├── test_arrow.py
│       ├── test_basic.py
│       ├── test_callback.py
│       ├── test_consistency.py
│       ├── test_dask.py
│       ├── test_dual.py
│       ├── test_engine.py
│       ├── test_plotting.py
│       ├── test_sklearn.py
│       ├── test_utilities.py
│       └── utils.py
└── windows/
    ├── LightGBM.sln
    ├── LightGBM.vcxproj
    └── LightGBM.vcxproj.filters
Download .txt
SYMBOL INDEX (1754 symbols across 138 files)

FILE: .ci/parameter-generator.py
  function get_parameter_infos (line 16) | def get_parameter_infos(config_hpp: Path) -> Tuple[List[Tuple[str, int]]...
  function get_names (line 89) | def get_names(infos: List[List[Dict[str, List]]]) -> List[str]:
  function get_alias (line 109) | def get_alias(infos: List[List[Dict[str, List]]]) -> List[Tuple[str, str]]:
  function parse_check (line 133) | def parse_check(check: str, reverse: bool = False) -> Tuple[str, str]:
  function set_one_var_from_string (line 161) | def set_one_var_from_string(name: str, param_type: str, checks: List[str...
  function gen_parameter_description (line 199) | def gen_parameter_description(
  function gen_parameter_code (line 263) | def gen_parameter_code(

FILE: R-package/src/lightgbm_R.cpp
  function delete_cpp_array (line 42) | void delete_cpp_array(SEXP R_ptr) {
  function delete_cpp_char_vec (line 48) | void delete_cpp_char_vec(SEXP R_ptr) {
  function SEXP (line 61) | SEXP make_altrepped_raw_vec(void *void_ptr) {
  function SEXP (line 75) | SEXP make_r_raw_vec(void *void_ptr) {
  function R_xlen_t (line 90) | R_xlen_t get_altrepped_raw_len(SEXP R_raw) {
  function R_altrep_class_t (line 104) | R_altrep_class_t get_altrep_class_for_type() {
  function SEXPTYPE (line 113) | SEXPTYPE get_sexptype_class_for_type() {
  function T (line 122) | T* get_r_vec_ptr(SEXP x) {
  type arr_and_len (line 132) | struct arr_and_len {
  function SEXP (line 139) | SEXP make_altrepped_vec_from_arr(void *void_ptr) {
  function SEXP (line 157) | SEXP make_R_vec_from_arr(void *void_ptr) {
  function R_xlen_t (line 168) | R_xlen_t get_altrepped_vec_len(SEXP R_vec) {
  type LGBM_R_ErrorClass (line 184) | struct LGBM_R_ErrorClass { SEXP cont_token; }
  function LGBM_R_save_exception_msg (line 205) | void LGBM_R_save_exception_msg(const std::exception &err) {
  function LGBM_R_save_exception_msg (line 209) | void LGBM_R_save_exception_msg(const std::string &err) {
  function SEXP (line 213) | SEXP wrapped_R_string(void *len) {
  function SEXP (line 217) | SEXP wrapped_R_raw(void *len) {
  function SEXP (line 221) | SEXP wrapped_R_int(void *len) {
  function SEXP (line 225) | SEXP wrapped_R_real(void *len) {
  function SEXP (line 229) | SEXP wrapped_Rf_mkChar(void *txt) {
  function throw_R_memerr (line 233) | void throw_R_memerr(void *ptr_cont_token, Rboolean jump) {
  function SEXP (line 240) | SEXP safe_R_string(R_xlen_t len, SEXP *cont_token) {
  function SEXP (line 244) | SEXP safe_R_raw(R_xlen_t len, SEXP *cont_token) {
  function SEXP (line 248) | SEXP safe_R_int(R_xlen_t len, SEXP *cont_token) {
  function SEXP (line 252) | SEXP safe_R_real(R_xlen_t len, SEXP *cont_token) {
  function SEXP (line 256) | SEXP safe_R_mkChar(char *txt, SEXP *cont_token) {
  function SEXP (line 263) | SEXP LGBM_HandleIsNull_R(SEXP handle) {
  function _DatasetFinalizer (line 267) | void _DatasetFinalizer(SEXP handle) {
  function SEXP (line 271) | SEXP LGBM_NullBoosterHandleError_R() {
  function _AssertBoosterHandleNotNull (line 279) | void _AssertBoosterHandleNotNull(SEXP handle) {
  function _AssertDatasetHandleNotNull (line 285) | void _AssertDatasetHandleNotNull(SEXP handle) {
  function SEXP (line 294) | SEXP LGBM_DatasetCreateFromFile_R(SEXP filename,
  function SEXP (line 314) | SEXP LGBM_DatasetCreateFromCSC_R(SEXP indptr,
  function SEXP (line 346) | SEXP LGBM_DatasetCreateFromMat_R(SEXP data,
  function SEXP (line 371) | SEXP LGBM_DatasetGetSubset_R(SEXP handle,
  function SEXP (line 400) | SEXP LGBM_DatasetSetFeatureNames_R(SEXP handle,
  function SEXP (line 417) | SEXP LGBM_DatasetGetFeatureNames_R(SEXP handle) {
  function SEXP (line 465) | SEXP LGBM_DatasetSaveBinary_R(SEXP handle,
  function SEXP (line 477) | SEXP LGBM_DatasetFree_R(SEXP handle) {
  function SEXP (line 487) | SEXP LGBM_DatasetSetField_R(SEXP handle,
  function SEXP (line 509) | SEXP LGBM_DatasetGetField_R(SEXP handle,
  function SEXP (line 541) | SEXP LGBM_DatasetGetFieldSize_R(SEXP handle,
  function SEXP (line 560) | SEXP LGBM_DatasetUpdateParamChecking_R(SEXP old_params,
  function SEXP (line 571) | SEXP LGBM_DatasetGetNumData_R(SEXP handle, SEXP out) {
  function SEXP (line 581) | SEXP LGBM_DatasetGetNumFeature_R(SEXP handle,
  function SEXP (line 592) | SEXP LGBM_DatasetGetFeatureNumBin_R(SEXP handle, SEXP feature_idx, SEXP ...
  function _BoosterFinalizer (line 605) | void _BoosterFinalizer(SEXP handle) {
  function SEXP (line 609) | SEXP LGBM_BoosterFree_R(SEXP handle) {
  function SEXP (line 619) | SEXP LGBM_BoosterCreate_R(SEXP train_data,
  function SEXP (line 634) | SEXP LGBM_BoosterCreateFromModelfile_R(SEXP filename) {
  function SEXP (line 648) | SEXP LGBM_BoosterLoadModelFromString_R(SEXP model_str) {
  function SEXP (line 679) | SEXP LGBM_BoosterMerge_R(SEXP handle,
  function SEXP (line 689) | SEXP LGBM_BoosterAddValidData_R(SEXP handle,
  function SEXP (line 699) | SEXP LGBM_BoosterResetTrainingData_R(SEXP handle,
  function SEXP (line 709) | SEXP LGBM_BoosterResetParameter_R(SEXP handle,
  function SEXP (line 720) | SEXP LGBM_BoosterGetNumClasses_R(SEXP handle,
  function SEXP (line 731) | SEXP LGBM_BoosterGetNumFeature_R(SEXP handle) {
  function SEXP (line 740) | SEXP LGBM_BoosterUpdateOneIter_R(SEXP handle) {
  function SEXP (line 749) | SEXP LGBM_BoosterUpdateOneIterCustom_R(SEXP handle,
  function SEXP (line 766) | SEXP LGBM_BoosterRollbackOneIter_R(SEXP handle) {
  function SEXP (line 774) | SEXP LGBM_BoosterGetCurrentIteration_R(SEXP handle, SEXP out) {
  function SEXP (line 784) | SEXP LGBM_BoosterNumModelPerIteration_R(SEXP handle, SEXP out) {
  function SEXP (line 794) | SEXP LGBM_BoosterNumberOfTotalModel_R(SEXP handle, SEXP out) {
  function SEXP (line 804) | SEXP LGBM_BoosterGetUpperBoundValue_R(SEXP handle,
  function SEXP (line 814) | SEXP LGBM_BoosterGetLowerBoundValue_R(SEXP handle,
  function SEXP (line 824) | SEXP LGBM_BoosterGetEvalNames_R(SEXP handle) {
  function SEXP (line 873) | SEXP LGBM_BoosterGetEval_R(SEXP handle,
  function SEXP (line 888) | SEXP LGBM_BoosterGetNumPredict_R(SEXP handle,
  function SEXP (line 900) | SEXP LGBM_BoosterGetPredict_R(SEXP handle,
  function GetPredictType (line 912) | int GetPredictType(SEXP is_rawscore, SEXP is_leafidx, SEXP is_predcontri...
  function SEXP (line 926) | SEXP LGBM_BoosterPredictForFile_R(SEXP handle,
  function SEXP (line 950) | SEXP LGBM_BoosterCalcNumPredict_R(SEXP handle,
  function SEXP (line 969) | SEXP LGBM_BoosterPredictForCSC_R(SEXP handle,
  function SEXP (line 1004) | SEXP LGBM_BoosterPredictForCSR_R(SEXP handle,
  function SEXP (line 1032) | SEXP LGBM_BoosterPredictForCSRSingleRow_R(SEXP handle,
  function LGBM_FastConfigFree_wrapped (line 1061) | void LGBM_FastConfigFree_wrapped(SEXP handle) {
  function SEXP (line 1065) | SEXP LGBM_BoosterPredictForCSRSingleRowFastInit_R(SEXP handle,
  function SEXP (line 1090) | SEXP LGBM_BoosterPredictForCSRSingleRowFast_R(SEXP handle_fastConfig,
  function SEXP (line 1107) | SEXP LGBM_BoosterPredictForMat_R(SEXP handle,
  type SparseOutputPointers (line 1135) | struct SparseOutputPointers {
    method SparseOutputPointers (line 1139) | SparseOutputPointers(void* indptr, int32_t* indices, void* data)
  function delete_SparseOutputPointers (line 1143) | void delete_SparseOutputPointers(SparseOutputPointers *ptr) {
  function SEXP (line 1148) | SEXP LGBM_BoosterPredictSparseOutput_R(SEXP handle,
  function SEXP (line 1214) | SEXP LGBM_BoosterPredictForMatSingleRow_R(SEXP handle,
  function SEXP (line 1238) | SEXP LGBM_BoosterPredictForMatSingleRowFastInit_R(SEXP handle,
  function SEXP (line 1263) | SEXP LGBM_BoosterPredictForMatSingleRowFast_R(SEXP handle_fastConfig,
  function SEXP (line 1274) | SEXP LGBM_BoosterSaveModel_R(SEXP handle,
  function SEXP (line 1292) | SEXP LGBM_BoosterSaveModelToString_R(SEXP handle,
  function SEXP (line 1316) | SEXP LGBM_BoosterSaveModelToString_R(SEXP handle,
  function SEXP (line 1343) | SEXP LGBM_BoosterDumpModel_R(SEXP handle,
  function SEXP (line 1370) | SEXP LGBM_DumpParamAliases_R() {
  function SEXP (line 1390) | SEXP LGBM_BoosterGetLoadedParam_R(SEXP handle) {
  function SEXP (line 1411) | SEXP LGBM_GetMaxThreads_R(SEXP out) {
  function SEXP (line 1420) | SEXP LGBM_SetMaxThreads_R(SEXP num_threads) {
  function R_init_lightgbm (line 1493) | void R_init_lightgbm(DllInfo *dll) {

FILE: docs/_static/js/script.js
  function uncollapse (line 42) | function uncollapse(section) {

FILE: docs/conf.py
  class InternalRefTransform (line 45) | class InternalRefTransform(Transform):
    method apply (line 51) | def apply(self, **kwargs: Any) -> None:
  class IgnoredDirective (line 58) | class IgnoredDirective(Directive):
    method run (line 63) | def run(self) -> List:
  function generate_doxygen_xml (line 218) | def generate_doxygen_xml(app: Sphinx) -> None:
  function generate_r_docs (line 262) | def generate_r_docs(app: Sphinx) -> None:
  function replace_reference_to_r_docs (line 311) | def replace_reference_to_r_docs(app: Sphinx) -> None:
  function setup (line 327) | def setup(app: Sphinx) -> None:

FILE: examples/python-guide/advanced_example.py
  function loglikelihood (line 142) | def loglikelihood(preds, train_data):
  function binary_error (line 157) | def binary_error(preds, train_data):
  function accuracy (line 181) | def accuracy(preds, train_data):
  function reset_metrics (line 206) | def reset_metrics():

FILE: examples/python-guide/dataset_from_multi_hdf5.py
  class HDFSequence (line 10) | class HDFSequence(lgb.Sequence):
    method __init__ (line 11) | def __init__(self, hdf_dataset, batch_size):
    method __getitem__ (line 26) | def __getitem__(self, idx):
    method __len__ (line 29) | def __len__(self):
  function create_dataset_from_multiple_hdf (line 33) | def create_dataset_from_multiple_hdf(input_flist, batch_size):
  function save2hdf (line 57) | def save2hdf(input_data, fname, batch_size):
  function generate_hdf (line 81) | def generate_hdf(input_fname, output_basename, batch_size):
  function main (line 99) | def main():

FILE: examples/python-guide/logistic_regression.py
  function log_loss (line 45) | def log_loss(preds, labels):
  function experiment (line 51) | def experiment(objective, label_type, data):

FILE: examples/python-guide/sklearn_example.py
  function rmsle (line 41) | def rmsle(y_true, y_pred):
  function rae (line 53) | def rae(y_true, y_pred):

FILE: include/LightGBM/application.h
  function namespace (line 15) | namespace LightGBM {

FILE: include/LightGBM/arrow.h
  type ArrowSchema (line 37) | struct ArrowSchema {
  type ArrowArray (line 53) | struct ArrowArray {
  function namespace (line 79) | namespace LightGBM {
  function class (line 232) | class ArrowTable {
  function ArrowChunkedArray (line 296) | inline const ArrowChunkedArray& get_column(size_t idx) const { return th...

FILE: include/LightGBM/bin.h
  function namespace (line 21) | namespace LightGBM {
  function class (line 263) | class BinIterator {
  function virtual (line 291) | virtual void InitStreaming(uint32_t /*num_thread*/, int32_t /*omp_max_th...
  function virtual (line 327) | virtual size_t SizesInByte() const = 0;

FILE: include/LightGBM/boosting.h
  function namespace (line 17) | namespace LightGBM {

FILE: include/LightGBM/c_api.h
  type ArrowArray (line 453) | struct ArrowArray
  type ArrowSchema (line 454) | struct ArrowSchema
  type ArrowArray (line 575) | struct ArrowArray
  type ArrowSchema (line 576) | struct ArrowSchema
  type ArrowArray (line 1454) | struct ArrowArray
  type ArrowSchema (line 1455) | struct ArrowSchema
  function INLINE_FUNCTION (line 1658) | INLINE_FUNCTION void LGBM_SetLastError(const char* msg) {

FILE: include/LightGBM/config.h
  function namespace (line 33) | namespace LightGBM {
  function GetString (line 1177) | inline bool Config::GetString(
  function GetInt (line 1187) | inline bool Config::GetInt(
  function GetDouble (line 1200) | inline bool Config::GetDouble(
  function GetBool (line 1213) | inline bool Config::GetBool(
  function SortAlias (line 1232) | inline bool Config::SortAlias(const std::string& x, const std::string& y) {
  function else (line 1236) | struct ParameterAlias {
  function std (line 1275) | inline std::string ParseObjectiveAlias(const std::string& type) {
  function std (line 1302) | inline std::string ParseMetricAlias(const std::string& type) {

FILE: include/LightGBM/cuda/cuda_algorithms.hpp
  type LightGBM (line 31) | namespace LightGBM {
    function __device__ (line 34) | __device__ __forceinline__ T ShufflePrefixSum(T value, T* shared_mem_b...
    function __device__ (line 65) | __device__ __forceinline__ T ShufflePrefixSumExclusive(T value, T* sha...
    function __device__ (line 113) | __device__ __forceinline__ T ShuffleReduceSumWarp(T value, const data_...
    function __device__ (line 125) | __device__ __forceinline__ T ShuffleReduceSum(T value, T* shared_mem_b...
    function __device__ (line 143) | __device__ __forceinline__ T ShuffleReduceMaxWarp(T value, const data_...
    function __device__ (line 155) | __device__ __forceinline__ T ShuffleReduceMax(T value, T* shared_mem_b...
    function __device__ (line 174) | __device__ __forceinline__ void GlobalMemoryPrefixSum(T* array, const ...
    function __device__ (line 193) | __device__ __forceinline__ T ShuffleReduceMinWarp(T value, const data_...
    function __device__ (line 206) | __device__ __forceinline__ T ShuffleReduceMin(T value, T* shared_mem_b...
    function __device__ (line 227) | __device__ __forceinline__ void BitonicArgSort_1024(const VAL_T* score...
    function __device__ (line 260) | __device__ __forceinline__ void BitonicArgSort_2048(const VAL_T* score...
    function __device__ (line 308) | __device__ void BitonicArgSortDevice(const VAL_T* values, INDEX_T* ind...
    function __device__ (line 487) | __device__ void ShuffleSortedPrefixSumDevice(const VAL_T* in_values,
    function __global__ (line 509) | __global__ void PercentileGlobalKernel(const VAL_T* values,
    function PercentileGlobal (line 553) | void PercentileGlobal(const VAL_T* values,
    function __device__ (line 575) | __device__ VAL_T PercentileDevice(const VAL_T* values,

FILE: include/LightGBM/cuda/cuda_column_data.hpp
  type LightGBM (line 21) | namespace LightGBM {
    class CUDAColumnData (line 23) | class CUDAColumnData {
      method feature_min_bin (line 50) | uint32_t feature_min_bin(const int feature_index) const { return fea...
      method feature_max_bin (line 52) | uint32_t feature_max_bin(const int feature_index) const { return fea...
      method feature_offset (line 54) | uint32_t feature_offset(const int feature_index) const { return feat...
      method feature_most_freq_bin (line 56) | uint32_t feature_most_freq_bin(const int feature_index) const { retu...
      method feature_default_bin (line 58) | uint32_t feature_default_bin(const int feature_index) const { return...
      method feature_missing_is_zero (line 60) | uint8_t feature_missing_is_zero(const int feature_index) const { ret...
      method feature_missing_is_na (line 62) | uint8_t feature_missing_is_na(const int feature_index) const { retur...
      method feature_mfb_is_zero (line 64) | uint8_t feature_mfb_is_zero(const int feature_index) const { return ...
      method feature_mfb_is_na (line 66) | uint8_t feature_mfb_is_na(const int feature_index) const { return fe...
      method feature_to_column (line 90) | int feature_to_column(const int feature_index) const { return featur...
      method column_bit_type (line 92) | uint8_t column_bit_type(const int column_index) const { return colum...
      method GetDataByColumnPointers (line 104) | std::vector<uint8_t*> GetDataByColumnPointers(const std::vector<std:...

FILE: include/LightGBM/cuda/cuda_metadata.hpp
  type LightGBM (line 17) | namespace LightGBM {
    class CUDAMetadata (line 19) | class CUDAMetadata {
      method label_t (line 39) | const label_t* cuda_label() const { return cuda_label_.RawData(); }
      method label_t (line 41) | const label_t* cuda_weights() const { return cuda_weights_.RawData(); }
      method data_size_t (line 43) | const data_size_t* cuda_query_boundaries() const { return cuda_query...
      method label_t (line 45) | const label_t* cuda_query_weights() const { return cuda_query_weight...

FILE: include/LightGBM/cuda/cuda_metric.hpp
  type LightGBM (line 16) | namespace LightGBM {
    class CUDAMetricInterface (line 19) | class CUDAMetricInterface: public HOST_METRIC {
      method CUDAMetricInterface (line 21) | explicit CUDAMetricInterface(const Config& config): HOST_METRIC(conf...
      method Init (line 28) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method IsCUDAMetric (line 34) | bool IsCUDAMetric() const { return true; }

FILE: include/LightGBM/cuda/cuda_nccl_topology.hpp
  type LightGBM (line 29) | namespace LightGBM {
    class NCCLTopology (line 31) | class NCCLTopology {
      method NCCLTopology (line 33) | NCCLTopology(const int master_gpu_device_id, const int num_gpu, cons...
      method InitNCCL (line 105) | void InitNCCL() {
      method RunPerDevice (line 155) | void RunPerDevice(const std::vector<std::unique_ptr<ARG_T>>& objs, c...
      method InitPerDevice (line 165) | void InitPerDevice(std::vector<std::unique_ptr<RET_T>>* vec) {
      method DispatchPerDevice (line 178) | void DispatchPerDevice(std::vector<std::unique_ptr<ARG_T>>* objs, co...
      method RunOnMasterDevice (line 192) | void RunOnMasterDevice(const std::vector<std::unique_ptr<ARG_T>>& ob...
      method RunOnNonMasterDevice (line 198) | void RunOnNonMasterDevice(const std::vector<std::unique_ptr<ARG_T>>&...
      method num_gpu (line 208) | int num_gpu() const { return num_gpu_; }
      method master_gpu_index (line 210) | int master_gpu_index() const { return master_gpu_index_; }
      method master_gpu_device_id (line 212) | int master_gpu_device_id() const { return master_gpu_device_id_; }

FILE: include/LightGBM/cuda/cuda_objective_function.hpp
  type LightGBM (line 20) | namespace LightGBM {
    class CUDAObjectiveInterface (line 23) | class CUDAObjectiveInterface: public HOST_OBJECTIVE, public NCCLInfo {
      method CUDAObjectiveInterface (line 25) | explicit CUDAObjectiveInterface(const Config& config): HOST_OBJECTIV...
      method CUDAObjectiveInterface (line 32) | explicit CUDAObjectiveInterface(const std::vector<std::string>& strs...
      method Init (line 34) | void Init(const Metadata& metadata, data_size_t num_data) {
      method SetNCCLInfo (line 40) | void SetNCCLInfo(
      method BoostFromScore (line 53) | double BoostFromScore(int class_id) const override {
      method IsCUDAObjective (line 57) | bool IsCUDAObjective() const override { return true; }
      method GetGradients (line 59) | void GetGradients(const double* scores, score_t* gradients, score_t*...
      method GetGradientsWithSampledQueries (line 64) | void GetGradientsWithSampledQueries(const double* scores, const data...
      method RenewTreeOutputCUDA (line 69) | void RenewTreeOutputCUDA(const double* score, const data_size_t* dat...
      method LaunchCalcInitScoreKernel (line 80) | virtual double LaunchCalcInitScoreKernel(const int class_id) const {
      method LaunchRenewTreeOutputCUDAKernel (line 86) | virtual void LaunchRenewTreeOutputCUDAKernel(

FILE: include/LightGBM/cuda/cuda_random.hpp
  type LightGBM (line 16) | namespace LightGBM {
    class CUDARandom (line 21) | class CUDARandom {
      method __device__ (line 26) | __device__ void SetSeed(int seed) {
      method __device__ (line 35) | __device__ inline int NextShort(int lower_bound, int upper_bound) {
      method __device__ (line 45) | __device__ inline int NextInt(int lower_bound, int upper_bound) {
      method __device__ (line 53) | __device__ inline float NextFloat() {
      method __device__ (line 59) | __device__ inline int RandInt16() {
      method __device__ (line 64) | __device__ inline int RandInt32() {

FILE: include/LightGBM/cuda/cuda_rocm_interop.h
  function WARP_SIZE_INTERNAL (line 55) | static inline constexpr int WARP_SIZE_INTERNAL() {

FILE: include/LightGBM/cuda/cuda_row_data.hpp
  type LightGBM (line 31) | namespace LightGBM {
    class CUDARowData (line 33) | class CUDARowData {
      method NumLargeBinPartition (line 61) | int NumLargeBinPartition() const { return static_cast<int>(large_bin...
      method num_feature_partitions (line 63) | int num_feature_partitions() const { return num_feature_partitions_; }
      method max_num_column_per_partition (line 65) | int max_num_column_per_partition() const { return max_num_column_per...
      method is_sparse (line 67) | bool is_sparse() const { return is_sparse_; }
      method bit_type (line 69) | uint8_t bit_type() const { return bit_type_; }
      method row_ptr_bit_type (line 71) | uint8_t row_ptr_bit_type() const { return row_ptr_bit_type_; }
      method shared_hist_size (line 79) | int shared_hist_size() const { return shared_hist_size_; }

FILE: include/LightGBM/cuda/cuda_split_info.hpp
  type LightGBM (line 16) | namespace LightGBM {
    class CUDASplitInfo (line 18) | class CUDASplitInfo {
      method __host__ (line 45) | __host__ __device__ CUDASplitInfo() {
      method CUDASplitInfo (line 62) | CUDASplitInfo& operator=(const CUDASplitInfo& other) {

FILE: include/LightGBM/cuda/cuda_tree.hpp
  type LightGBM (line 17) | namespace LightGBM {
    class CUDATree (line 29) | class CUDATree : public Tree {

FILE: include/LightGBM/cuda/vector_cudahost.h
  type LGBM_Device (line 22) | enum LGBM_Device {
  type Use_Learner (line 28) | enum Use_Learner {
  function namespace (line 34) | namespace LightGBM {

FILE: include/LightGBM/dataset.h
  function namespace (line 32) | namespace LightGBM {
  function PushOneData (line 620) | inline void PushOneData(int tid, data_size_t row_idx, int group, int fea...
  function InsertMetadataAt (line 630) | inline void InsertMetadataAt(data_size_t start_index,
  function RealFeatureIndex (line 639) | inline int RealFeatureIndex(int fidx) const {
  function InnerFeatureIndex (line 643) | inline int InnerFeatureIndex(int col_idx) const {
  function Feature2Group (line 646) | inline int Feature2Group(int feature_idx) const {
  function Feature2SubFeature (line 649) | inline int Feature2SubFeature(int feature_idx) const {
  function GroupBinBoundary (line 652) | inline uint64_t GroupBinBoundary(int group_idx) const {
  function ConstructHistograms (line 738) | void ConstructHistograms(
  function data_size_t (line 776) | inline data_size_t Split(int feature, const uint32_t* threshold,
  function SubFeatureBinOffset (line 788) | inline int SubFeatureBinOffset(int i) const {
  function FeatureNumBin (line 797) | inline int FeatureNumBin(int i) const {
  function FeatureGroupNumBin (line 803) | inline int FeatureGroupNumBin(int group) const {
  function BinMapper (line 807) | inline const BinMapper* FeatureBinMapper(int i) const {
  function Bin (line 813) | inline const Bin* FeatureGroupBin(int group) const {
  function BinIterator (line 817) | inline BinIterator* FeatureIterator(int i) const {
  function BinIterator (line 823) | inline BinIterator* FeatureGroupIterator(int group) const {
  function IsMultiGroup (line 827) | inline bool IsMultiGroup(int i) const {
  function FeatureGroupSizesInByte (line 831) | inline size_t FeatureGroupSizesInByte(int group) const {
  function RealThreshold (line 854) | inline double RealThreshold(int i, uint32_t threshold) const {
  function BinThreshold (line 861) | inline uint32_t BinThreshold(int i, double threshold_double) const {
  function MaxRealCatValue (line 867) | inline int MaxRealCatValue(int i) const {
  function set_feature_names (line 900) | inline void set_feature_names(const std::vector<std::string>& feature_na...
  function set_wait_for_manual_finish (line 954) | inline void set_wait_for_manual_finish(bool value) {
  function SetHasRaw (line 970) | inline void SetHasRaw(bool has_raw) { has_raw_ = has_raw; }
  function ResizeRaw (line 973) | inline void ResizeRaw(int num_rows) {
  function feature_max_bin (line 991) | inline uint32_t feature_max_bin(const int inner_feature_index) const {
  function feature_min_bin (line 997) | inline uint32_t feature_min_bin(const int inner_feature_index) const {
  function CUDAColumnData (line 1005) | const CUDAColumnData* cuda_column_data() const {

FILE: include/LightGBM/dataset_loader.h
  function namespace (line 16) | namespace LightGBM {

FILE: include/LightGBM/feature_group.h
  function namespace (line 19) | namespace LightGBM {
  function AllocateBins (line 213) | inline void AllocateBins(data_size_t num_data) {
  function InitStreaming (line 237) | void InitStreaming(int32_t num_thread, int32_t omp_max_threads) {
  function PushData (line 254) | inline void PushData(int tid, int sub_feature_idx, data_size_t line_idx,...
  function ReSize (line 270) | void ReSize(int num_data) {
  function CopySubrow (line 280) | inline void CopySubrow(const FeatureGroup* full_feature, const data_size...
  function CopySubrowByCol (line 290) | inline void CopySubrowByCol(const FeatureGroup* full_feature, const data...
  function AddFeaturesFrom (line 298) | void AddFeaturesFrom(const FeatureGroup* other, int group_id) {
  function BinIterator (line 348) | inline BinIterator* SubFeatureIterator(int sub_feature) {
  function FinishLoad (line 363) | inline void FinishLoad() {
  function BinIterator (line 378) | inline BinIterator* FeatureGroupIterator() {
  function FeatureGroupSizesInByte (line 388) | inline size_t FeatureGroupSizesInByte() {
  function data_size_t (line 399) | inline data_size_t Split(int sub_feature, const uint32_t* threshold,
  function BinToValue (line 452) | inline double BinToValue(int sub_feature_idx, uint32_t bin) const {
  function feature_max_bin (line 569) | uint32_t feature_max_bin(const int sub_feature_index) {
  function feature_min_bin (line 578) | uint32_t feature_min_bin(const int sub_feature_index) {

FILE: include/LightGBM/meta.h
  function namespace (line 26) | namespace LightGBM {

FILE: include/LightGBM/metric.h
  function namespace (line 19) | namespace LightGBM {

FILE: include/LightGBM/network.h
  function namespace (line 17) | namespace LightGBM {

FILE: include/LightGBM/objective_function.h
  function namespace (line 16) | namespace LightGBM {

FILE: include/LightGBM/prediction_early_stop.h
  function namespace (line 14) | namespace LightGBM {

FILE: include/LightGBM/sample_strategy.h
  function namespace (line 22) | namespace LightGBM {

FILE: include/LightGBM/train_share_states.h
  function namespace (line 19) | namespace LightGBM {
  function else (line 129) | else if (HIST_BITS == 16) {
  function SetUseSubrow (line 214) | void SetUseSubrow(bool is_use_subrow) {
  function SetSubrowCopied (line 218) | void SetSubrowCopied(bool is_subrow_copied) {
  function num_hist_total_bin (line 269) | struct TrainingShareStates {
  function IsSparseRowwise (line 288) | bool IsSparseRowwise() {
  function InitTrain (line 299) | void InitTrain(const std::vector<int>& group_feature_start,
  function SetUseSubrow (line 323) | void SetUseSubrow(bool is_use_subrow) {
  function SetSubrowCopied (line 329) | void SetSubrowCopied(bool is_subrow_copied) {

FILE: include/LightGBM/tree.h
  function namespace (line 19) | namespace LightGBM {
  function Predict (line 588) | inline double Tree::Predict(const double* feature_values) const {
  function PredictByMap (line 618) | inline double Tree::PredictByMap(const std::unordered_map<int, double>& ...
  function PredictLeafIndex (line 651) | inline int Tree::PredictLeafIndex(const double* feature_values) const {
  function PredictLeafIndexByMap (line 660) | inline int Tree::PredictLeafIndexByMap(const std::unordered_map<int, dou...
  function PredictContrib (line 669) | inline void Tree::PredictContrib(const double* feature_values, int num_f...
  function PredictContribByMap (line 680) | inline void Tree::PredictContribByMap(const std::unordered_map<int, doub...
  function RecomputeLeafDepths (line 692) | inline void Tree::RecomputeLeafDepths(int node, int depth) {
  function GetLeaf (line 702) | inline int Tree::GetLeaf(const double* feature_values) const {
  function GetLeafByMap (line 716) | inline int Tree::GetLeafByMap(const std::unordered_map<int, double>& fea...

FILE: include/LightGBM/tree_learner.h
  function namespace (line 16) | namespace LightGBM {

FILE: include/LightGBM/utils/array_args.h
  function namespace (line 16) | namespace LightGBM {

FILE: include/LightGBM/utils/binary_writer.h
  function namespace (line 12) | namespace LightGBM {

FILE: include/LightGBM/utils/byte_buffer.h
  function namespace (line 20) | namespace LightGBM {

FILE: include/LightGBM/utils/chunked_array.hpp
  type LightGBM (line 20) | namespace LightGBM {
    class ChunkedArray (line 62) | class ChunkedArray {
      method ChunkedArray (line 64) | explicit ChunkedArray(size_t chunk_size)
      method add (line 82) | void add(T value) {
      method get_add_count (line 96) | size_t get_add_count() const {
      method get_chunks_count (line 103) | size_t get_chunks_count() const {
      method get_last_chunk_add_count (line 110) | size_t get_last_chunk_add_count() const {
      method get_chunk_size (line 119) | size_t get_chunk_size() const {
      method T (line 128) | T **data() noexcept {
      method coalesce_to (line 151) | void coalesce_to(T *other, bool all_valid_addresses = false) const {
      method T (line 179) | T getitem(size_t chunk_index, size_t index_within_chunk, T on_fail_v...
      method setitem (line 195) | int setitem(size_t chunk_index, size_t index_within_chunk, T value) ...
      method clear (line 208) | void clear() noexcept {
      method release (line 217) | void release() noexcept {
      method within_bounds (line 232) | inline bool within_bounds(size_t chunk_index, size_t index_within_ch...
      method new_chunk (line 239) | void new_chunk() {

FILE: include/LightGBM/utils/common.h
  function namespace (line 59) | namespace LightGBM {
  function std (line 459) | static std::vector<T> StringToArray(const std::string& str, int n) {
  function std (line 492) | static std::vector<T> StringToArrayFast(const std::string& str, int n) {
  function Pow2RoundUp (line 561) | inline static int64_t Pow2RoundUp(int64_t x) {
  function Softmax (line 576) | inline static void Softmax(std::vector<double>* p_rec) {
  function Softmax (line 592) | inline static void Softmax(const double* input, double* output, int len) {
  function std (line 640) | static std::vector<T*> Vector2Ptr(std::vector<std::vector<T>>* data) {
  function std (line 650) | static std::vector<int> VectorSize(const std::vector<std::vector<T>>& da...
  function AvoidInf (line 658) | inline static double AvoidInf(double x) {
  function AvoidInf (line 670) | inline static float AvoidInf(float x) {
  function typename (line 683) | static typename std::iterator_traits<_Iter>::value_type* IteratorValType...
  function ParallelSort (line 688) | static void ParallelSort(_RanIt _First, _RanIt _Last, _Pr _Pred, _VTRanI...
  function ParallelSort (line 732) | static void ParallelSort(_RanIt _First, _RanIt _Last, _Pr _Pred) {
  function CheckElementsIntervalClosed (line 738) | static void CheckElementsIntervalClosed(const T *y, T ymin, T ymax, int ...
  function ObtainMinMaxSum (line 769) | static void ObtainMinMaxSum(const T1 *w, int nw, T1 *mi, T1 *ma, T2 *su) {
  function std (line 811) | inline static std::vector<uint32_t> EmptyBitset(int n) {
  function InsertBitset (line 818) | static void InsertBitset(std::vector<uint32_t>* vec, const T val) {
  function std (line 829) | static std::vector<uint32_t> ConstructBitset(const T* vals, int n) {
  function FindInBitset (line 843) | static bool FindInBitset(const uint32_t* bits, int n, T pos) {
  function CheckDoubleEqualOrdered (line 852) | inline static bool CheckDoubleEqualOrdered(double a, double b) {
  function GetDoubleUpperBound (line 857) | inline static double GetDoubleUpperBound(double a) {
  function GetLine (line 861) | inline static size_t GetLine(const char* str) {
  function Sign (line 880) | int Sign(T x) {
  function T (line 885) | T SafeLog(T x) {
  function CheckAllowedJSON (line 893) | inline bool CheckAllowedJSON(const std::string& s) {
  function class (line 980) | class Timer {
  function class (line 1044) | class FunctionTimer {
  function namespace (line 1071) | namespace CommonC {
  function T (line 1112) | T operator()(const std::string& str) const {
  function T (line 1128) | T operator()(const std::string& str) const {
  function std (line 1149) | static std::vector<T> StringToArrayFast(const std::string& str, int n) {
  function std (line 1168) | static std::vector<T> StringToArray(const std::string& str, int n) {
  function std (line 1189) | static std::vector<T> StringToArray(const std::string& str, char delimit...
  function format_to_buf (line 1209) | static void format_to_buf(char* buffer, const size_t buf_len, const char...
  function const (line 1219) | void operator()(T value, char* buffer, size_t buf_len) const {
  function std (line 1247) | static std::string ArrayToString(const std::vector<T>& arr, size_t n) {

FILE: include/LightGBM/utils/file_io.h
  function namespace (line 19) | namespace LightGBM {

FILE: include/LightGBM/utils/json11.h
  function namespace (line 63) | namespace json11_internal_lightgbm {
  function class (line 206) | class JsonValue {

FILE: include/LightGBM/utils/log.h
  function LogLevel (line 79) | enum class LogLevel : int {

FILE: include/LightGBM/utils/openmp_wrapper.h
  function class (line 50) | class ThreadExceptionHelper {
  function OMP_SET_NUM_THREADS (line 122) | inline void OMP_SET_NUM_THREADS(int) __GOMP_NOTHROW {}
  function omp_get_thread_num (line 123) | inline int omp_get_thread_num() __GOMP_NOTHROW {return 0;}
  function OMP_NUM_THREADS (line 124) | inline int OMP_NUM_THREADS() __GOMP_NOTHROW { return 1; }

FILE: include/LightGBM/utils/pipeline_reader.h
  function namespace (line 20) | namespace LightGBM {

FILE: include/LightGBM/utils/random.h
  function namespace (line 14) | namespace LightGBM {

FILE: include/LightGBM/utils/text_reader.h
  function namespace (line 19) | namespace LightGBM {
  function Clear (line 73) | inline void Clear() {
  function std (line 80) | inline std::string first_line() {
  function std (line 87) | inline std::vector<std::string>& Lines() { return lines_; }
  function INDEX_T (line 100) | INDEX_T ReadAllAndProcess(const std::function<void(INDEX_T, const char*,...
  function INDEX_T (line 162) | INDEX_T ReadAllLines() {
  function INDEX_T (line 187) | INDEX_T SampleFromFile(Random* random, INDEX_T sample_cnt, std::vector<s...
  function INDEX_T (line 209) | INDEX_T ReadAndFilterLines(const std::function<bool(INDEX_T)>& filter_fu...
  function INDEX_T (line 223) | INDEX_T SampleAndFilterFromFile(const std::function<bool(INDEX_T)>& filt...
  function INDEX_T (line 248) | INDEX_T CountLine() {
  function INDEX_T (line 254) | INDEX_T ReadAllAndProcessParallelWithFilter(const std::function<void(IND...
  function INDEX_T (line 327) | INDEX_T ReadAllAndProcessParallel(const std::function<void(INDEX_T, cons...
  function INDEX_T (line 331) | INDEX_T ReadPartAndProcessParallel(const std::vector<INDEX_T>& used_data...

FILE: include/LightGBM/utils/threading.h
  function namespace (line 18) | namespace LightGBM {

FILE: include/LightGBM/utils/yamc/alternate_shared_mutex.hpp
  type yamc (line 36) | namespace yamc {
    type alternate (line 46) | namespace alternate {
      type detail (line 48) | namespace detail {
        class shared_mutex_base (line 51) | class shared_mutex_base {
          method lock (line 57) | void lock() {
          method try_lock (line 67) | bool try_lock() {
          method unlock (line 74) | void unlock() {
          method lock_shared (line 80) | void lock_shared() {
          method try_lock_shared (line 88) | bool try_lock_shared() {
          method unlock_shared (line 95) | void unlock_shared() {
      class basic_shared_mutex (line 106) | class basic_shared_mutex : private detail::shared_mutex_base<RwLockP...
        method basic_shared_mutex (line 110) | basic_shared_mutex() = default;
        method basic_shared_mutex (line 113) | basic_shared_mutex(const basic_shared_mutex&) = delete;
        method basic_shared_mutex (line 114) | basic_shared_mutex& operator=(const basic_shared_mutex&) = delete;
      class basic_shared_timed_mutex (line 128) | class basic_shared_timed_mutex
        method do_try_lockwait (line 137) | bool do_try_lockwait(const std::chrono::time_point<Clock, Duration...
        method do_try_lock_sharedwait (line 154) | bool do_try_lock_sharedwait(
        method basic_shared_timed_mutex (line 169) | basic_shared_timed_mutex() = default;
        method basic_shared_timed_mutex (line 172) | basic_shared_timed_mutex(const basic_shared_timed_mutex&) = delete;
        method basic_shared_timed_mutex (line 173) | basic_shared_timed_mutex& operator=(const basic_shared_timed_mutex...
        method try_lock_for (line 180) | bool try_lock_for(const std::chrono::duration<Rep, Period>& durati...
        method try_lock_until (line 186) | bool try_lock_until(const std::chrono::time_point<Clock, Duration>...
        method try_lock_shared_for (line 195) | bool try_lock_shared_for(const std::chrono::duration<Rep, Period>&...
        method try_lock_shared_until (line 201) | bool try_lock_shared_until(

FILE: include/LightGBM/utils/yamc/yamc_rwlock_sched.hpp
  type yamc (line 37) | namespace yamc {
    type rwlock (line 45) | namespace rwlock {
      type ReaderPrefer (line 54) | struct ReaderPrefer {
        type state (line 58) | struct state {
        method before_wait_wlock (line 62) | static void before_wait_wlock(const state&) {}
        method after_wait_wlock (line 63) | static void after_wait_wlock(const state&) {}
        method wait_wlock (line 65) | static bool wait_wlock(const state& s) { return (s.rwcount != 0); }
        method acquire_wlock (line 67) | static void acquire_wlock(state* s) {
        method release_wlock (line 72) | static void release_wlock(state* s) {
        method wait_rlock (line 77) | static bool wait_rlock(const state& s) { return (s.rwcount & write...
        method acquire_rlock (line 79) | static void acquire_rlock(state* s) {
        method release_rlock (line 84) | static bool release_rlock(state* s) {
      type WriterPrefer (line 100) | struct WriterPrefer {
        type state (line 104) | struct state {
        method before_wait_wlock (line 109) | static void before_wait_wlock(state* s) {
        method wait_wlock (line 114) | static bool wait_wlock(const state& s) {
        method after_wait_wlock (line 118) | static void after_wait_wlock(state* s) {
        method acquire_wlock (line 123) | static void acquire_wlock(state* s) {
        method release_wlock (line 128) | static void release_wlock(state* s) {
        method wait_rlock (line 133) | static bool wait_rlock(const state& s) { return (s.nwriter != 0); }
        method acquire_rlock (line 135) | static void acquire_rlock(state* s) {
        method release_rlock (line 140) | static bool release_rlock(state* s) {

FILE: include/LightGBM/utils/yamc/yamc_shared_lock.hpp
  type yamc (line 42) | namespace yamc {
    class shared_lock (line 45) | class shared_lock {
      method locking_precondition (line 46) | void locking_precondition(const char* emsg) {
      method shared_lock (line 60) | shared_lock() noexcept = default;
      method shared_lock (line 62) | explicit shared_lock(mutex_type* m) {
      method shared_lock (line 68) | shared_lock(const mutex_type& m, std::defer_lock_t) noexcept {
      method shared_lock (line 73) | shared_lock(const mutex_type& m, std::try_to_lock_t) {
      method shared_lock (line 78) | shared_lock(const mutex_type& m, std::adopt_lock_t) {
      method shared_lock (line 84) | shared_lock(const mutex_type& m,
      method shared_lock (line 91) | shared_lock(const mutex_type& m,
      method shared_lock (line 104) | shared_lock(const shared_lock&) = delete;
      method shared_lock (line 105) | shared_lock& operator=(const shared_lock&) = delete;
      method shared_lock (line 107) | shared_lock(shared_lock&& rhs) noexcept {
      method shared_lock (line 117) | shared_lock& operator=(shared_lock&& rhs) noexcept {
      method lock (line 128) | void lock() {
      method try_lock (line 134) | bool try_lock() {
      method try_lock_for (line 140) | bool try_lock_for(const std::chrono::duration<Rep, Period>& rel_time) {
      method try_lock_until (line 146) | bool try_lock_until(
      method unlock (line 152) | void unlock() {
      method swap (line 163) | void swap(shared_lock& sl) noexcept {
      method mutex_type (line 168) | mutex_type* release() noexcept {
      method owns_lock (line 175) | bool owns_lock() const noexcept { return owns_; }
      method mutex_type (line 179) | mutex_type* mutex() const noexcept { return pm_; }
  type std (line 188) | namespace std {
    function swap (line 192) | void swap(yamc::shared_lock<Mutex>& lhs,

FILE: python-package/lightgbm/basic.py
  class LightGBMError (line 176) | class LightGBMError(Exception):
  function _is_zero (line 182) | def _is_zero(x: float) -> bool:
  function _get_sample_count (line 186) | def _get_sample_count(total_nrow: int, params: str) -> int:
  function _np2d_to_np1d (line 198) | def _np2d_to_np1d(mat: np.ndarray) -> Tuple[np.ndarray, int]:
  class _MissingType (line 217) | class _MissingType(Enum):
  class _DummyLogger (line 223) | class _DummyLogger:
    method info (line 224) | def info(self, msg: str) -> None:
    method warning (line 227) | def warning(self, msg: str) -> None:
  function _has_method (line 236) | def _has_method(logger: Any, method_name: str) -> bool:
  function register_logger (line 240) | def register_logger(
  function _normalize_native_string (line 265) | def _normalize_native_string(func: Callable[[str], None]) -> Callable[[s...
  function _log_info (line 282) | def _log_info(msg: str) -> None:
  function _log_warning (line 286) | def _log_warning(msg: str) -> None:
  function _log_native (line 291) | def _log_native(msg: str) -> None:
  function _log_callback (line 295) | def _log_callback(msg: bytes) -> None:
  function _safe_call (line 312) | def _safe_call(ret: int) -> None:
  function _is_numeric (line 324) | def _is_numeric(obj: Any) -> bool:
  function _is_numpy_1d_array (line 335) | def _is_numpy_1d_array(data: Any) -> bool:
  function _is_numpy_column_array (line 340) | def _is_numpy_column_array(data: Any) -> bool:
  function _cast_numpy_array_to_dtype (line 348) | def _cast_numpy_array_to_dtype(array: np.ndarray, dtype: "np.typing.DTyp...
  function _is_1d_list (line 355) | def _is_1d_list(data: Any) -> bool:
  function _is_list_of_numpy_arrays (line 360) | def _is_list_of_numpy_arrays(data: Any) -> "TypeGuard[List[np.ndarray]]":
  function _is_list_of_sequences (line 364) | def _is_list_of_sequences(data: Any) -> "TypeGuard[List[Sequence]]":
  function _is_1d_collection (line 368) | def _is_1d_collection(data: Any) -> bool:
  function _list_to_1d_numpy (line 373) | def _list_to_1d_numpy(
  function _is_numpy_2d_array (line 397) | def _is_numpy_2d_array(data: Any) -> bool:
  function _is_2d_list (line 402) | def _is_2d_list(data: Any) -> bool:
  function _is_2d_collection (line 407) | def _is_2d_collection(data: Any) -> bool:
  function _is_pyarrow_array (line 412) | def _is_pyarrow_array(data: Any) -> "TypeGuard[Union[pa_Array, pa_Chunke...
  function _is_pyarrow_table (line 417) | def _is_pyarrow_table(data: Any) -> "TypeGuard[pa_Table]":
  class _ArrowCArray (line 422) | class _ArrowCArray:
    method __init__ (line 429) | def __init__(self, n_chunks: int, chunks: arrow_cffi.CData, schema: ar...
    method chunks_ptr (line 435) | def chunks_ptr(self) -> int:
    method schema_ptr (line 440) | def schema_ptr(self) -> int:
  function _export_arrow_to_c (line 445) | def _export_arrow_to_c(data: pa_Table) -> _ArrowCArray:
  function _data_to_2d_numpy (line 473) | def _data_to_2d_numpy(
  function _cfloat32_array_to_numpy (line 492) | def _cfloat32_array_to_numpy(*, cptr: "ctypes._Pointer", length: int) ->...
  function _cfloat64_array_to_numpy (line 500) | def _cfloat64_array_to_numpy(*, cptr: "ctypes._Pointer", length: int) ->...
  function _cint32_array_to_numpy (line 508) | def _cint32_array_to_numpy(*, cptr: "ctypes._Pointer", length: int) -> n...
  function _cint64_array_to_numpy (line 516) | def _cint64_array_to_numpy(*, cptr: "ctypes._Pointer", length: int) -> n...
  function _c_str (line 524) | def _c_str(string: str) -> ctypes.c_char_p:
  function _c_array (line 529) | def _c_array(ctype: type, values: List[Any]) -> ctypes.Array:
  function _json_default_with_numpy (line 534) | def _json_default_with_numpy(obj: Any) -> Any:
  function _to_string (line 544) | def _to_string(x: Union[int, float, str, List]) -> str:
  function _param_dict_to_str (line 552) | def _param_dict_to_str(data: Optional[Dict[str, Any]]) -> str:
  class _TempFile (line 567) | class _TempFile:
    method __enter__ (line 570) | def __enter__(self) -> "_TempFile":
    method __exit__ (line 576) | def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:
  class LGBMDeprecationWarning (line 583) | class LGBMDeprecationWarning(FutureWarning):
  class _ConfigAliases (line 589) | class _ConfigAliases:
    method _get_all_param_aliases (line 594) | def _get_all_param_aliases() -> Dict[str, List[str]]:
    method get (line 623) | def get(cls, *args: str) -> Set[str]:
    method get_sorted (line 632) | def get_sorted(cls, name: str) -> List[str]:
    method get_by_alias (line 638) | def get_by_alias(cls, *args: str) -> Set[str]:
  function _choose_param_value (line 650) | def _choose_param_value(main_param_name: str, params: Dict[str, Any], de...
  function _convert_from_sliced_object (line 739) | def _convert_from_sliced_object(data: np.ndarray) -> np.ndarray:
  function _c_float_array (line 751) | def _c_float_array(data: np.ndarray) -> Tuple[_ctypes_float_ptr, int, np...
  function _c_int_array (line 772) | def _c_int_array(data: np.ndarray) -> Tuple[_ctypes_int_ptr, int, np.nda...
  function _is_allowed_numpy_dtype (line 793) | def _is_allowed_numpy_dtype(dtype: type) -> bool:
  function _check_for_bad_pandas_dtypes (line 798) | def _check_for_bad_pandas_dtypes(pandas_dtypes_series: pd_Series) -> None:
  function _pandas_to_numpy (line 810) | def _pandas_to_numpy(
  function _data_from_pandas (line 827) | def _data_from_pandas(
  function _dump_pandas_categorical (line 875) | def _dump_pandas_categorical(
  function _load_pandas_categorical (line 887) | def _load_pandas_categorical(
  class Sequence (line 915) | class Sequence(abc.ABC):
    method __getitem__ (line 946) | def __getitem__(self, idx: Union[int, slice, List[int]]) -> np.ndarray:
    method __len__ (line 976) | def __len__(self) -> int:
  class _InnerPredictor (line 981) | class _InnerPredictor:
    method __init__ (line 992) | def __init__(
    method from_booster (line 1028) | def from_booster(
    method from_model_file (line 1057) | def from_model_file(
    method __del__ (line 1087) | def __del__(self) -> None:
    method __getstate__ (line 1094) | def __getstate__(self) -> Dict[str, Any]:
    method predict (line 1100) | def predict(
    method __get_num_preds (line 1253) | def __get_num_preds(
    method __inner_predict_np2d (line 1282) | def __inner_predict_np2d(
    method __pred_for_np2d (line 1323) | def __pred_for_np2d(
    method __create_sparse_native (line 1370) | def __create_sparse_native(
    method __inner_predict_csr (line 1432) | def __inner_predict_csr(
    method __inner_predict_csr_sparse (line 1482) | def __inner_predict_csr_sparse(
    method __pred_for_csr (line 1540) | def __pred_for_csr(
    method __inner_predict_sparse_csc (line 1591) | def __inner_predict_sparse_csc(
    method __pred_for_csc (line 1649) | def __pred_for_csc(
    method __pred_for_pyarrow_table (line 1710) | def __pred_for_pyarrow_table(
    method current_iteration (line 1755) | def current_iteration(self) -> int:
  class Dataset (line 1773) | class Dataset:
    method __init__ (line 1784) | def __init__(
    method __del__ (line 1859) | def __del__(self) -> None:
    method _create_sample_indices (line 1865) | def _create_sample_indices(self, *, total_nrow: int) -> np.ndarray:
    method _init_from_ref_dataset (line 1899) | def _init_from_ref_dataset(
    method _init_from_sample (line 1928) | def _init_from_sample(
    method _push_rows (line 1992) | def _push_rows(self, data: np.ndarray) -> "Dataset":
    method get_params (line 2022) | def get_params(self) -> Dict[str, Any]:
    method _free_handle (line 2059) | def _free_handle(self) -> "Dataset":
    method _set_init_score_by_predictor (line 2068) | def _set_init_score_by_predictor(
    method _lazy_init (line 2111) | def _lazy_init(
    method _yield_row_from_seqlist (line 2236) | def _yield_row_from_seqlist(seqs: List[Sequence], indices: Iterable[in...
    method __sample (line 2250) | def __sample(self, *, seqs: List[Sequence], total_nrow: int) -> Tuple[...
    method __init_from_seqs (line 2278) | def __init_from_seqs(
    method __init_from_np2d (line 2312) | def __init_from_np2d(
    method __init_from_list_np2d (line 2340) | def __init_from_list_np2d(
    method __init_from_csr (line 2395) | def __init_from_csr(
    method __init_from_csc (line 2430) | def __init_from_csc(
    method __init_from_pyarrow_table (line 2465) | def __init_from_pyarrow_table(
    method _compare_params_for_warning (line 2496) | def _compare_params_for_warning(
    method construct (line 2530) | def construct(self) -> "Dataset":
    method create_valid (line 2625) | def create_valid(
    method subset (line 2679) | def subset(
    method save_binary (line 2713) | def save_binary(self, filename: Union[str, Path]) -> "Dataset":
    method _update_params (line 2739) | def _update_params(self, params: Optional[Dict[str, Any]]) -> "Dataset":
    method _reverse_update_params (line 2767) | def _reverse_update_params(self) -> "Dataset":
    method set_field (line 2773) | def set_field(
    method get_field (line 2876) | def get_field(self, field_name: str) -> Optional[np.ndarray]:
    method set_categorical_feature (line 2937) | def set_categorical_feature(
    method _set_predictor (line 2975) | def _set_predictor(
    method set_reference (line 3014) | def set_reference(self, reference: "Dataset") -> "Dataset":
    method set_feature_name (line 3042) | def set_feature_name(self, feature_name: _LGBM_FeatureNameConfiguratio...
    method set_label (line 3072) | def set_label(self, label: Optional[_LGBM_LabelType]) -> "Dataset":
    method set_weight (line 3099) | def set_weight(
    method set_init_score (line 3132) | def set_init_score(
    method set_group (line 3154) | def set_group(
    method set_position (line 3185) | def set_position(
    method get_feature_name (line 3207) | def get_feature_name(self) -> List[str]:
    method get_label (line 3252) | def get_label(self) -> Optional[_LGBM_LabelType]:
    method get_weight (line 3265) | def get_weight(self) -> Optional[_LGBM_WeightType]:
    method get_init_score (line 3278) | def get_init_score(self) -> Optional[_LGBM_InitScoreType]:
    method get_data (line 3291) | def get_data(self) -> Optional[_LGBM_TrainDataType]:
    method get_group (line 3326) | def get_group(self) -> Optional[_LGBM_GroupType]:
    method get_position (line 3346) | def get_position(self) -> Optional[_LGBM_PositionType]:
    method num_data (line 3359) | def num_data(self) -> int:
    method num_feature (line 3379) | def num_feature(self) -> int:
    method feature_num_bin (line 3399) | def feature_num_bin(self, feature: Union[int, str]) -> int:
    method get_ref_chain (line 3431) | def get_ref_chain(self, ref_limit: int = 100) -> Set["Dataset"]:
    method add_features_from (line 3461) | def add_features_from(self, other: "Dataset") -> "Dataset":
    method _dump_text (line 3541) | def _dump_text(self, filename: Union[str, Path]) -> "Dataset":
  class Booster (line 3581) | class Booster:
    method __init__ (line 3584) | def __init__(
    method __del__ (line 3722) | def __del__(self) -> None:
    method __copy__ (line 3734) | def __copy__(self) -> "Booster":
    method __deepcopy__ (line 3737) | def __deepcopy__(self, *args: Any, **kwargs: Any) -> "Booster":
    method __getstate__ (line 3741) | def __getstate__(self) -> Dict[str, Any]:
    method __setstate__ (line 3750) | def __setstate__(self, state: Dict[str, Any]) -> None:
    method _get_loaded_param (line 3765) | def _get_loaded_param(self) -> Dict[str, Any]:
    method free_dataset (line 3793) | def free_dataset(self) -> "Booster":
    method _free_buffer (line 3806) | def _free_buffer(self) -> "Booster":
    method set_network (line 3811) | def set_network(
    method free_network (line 3849) | def free_network(self) -> "Booster":
    method trees_to_dataframe (line 3861) | def trees_to_dataframe(self) -> pd_DataFrame:
    method set_train_data_name (line 4019) | def set_train_data_name(self, name: str) -> "Booster":
    method add_valid (line 4035) | def add_valid(self, data: Dataset, name: str) -> "Booster":
    method reset_parameter (line 4067) | def reset_parameter(self, params: Dict[str, Any]) -> "Booster":
    method update (line 4091) | def update(
    method __boost (line 4172) | def __boost(
    method rollback_one_iter (line 4234) | def rollback_one_iter(self) -> "Booster":
    method current_iteration (line 4246) | def current_iteration(self) -> int:
    method num_model_per_iteration (line 4263) | def num_model_per_iteration(self) -> int:
    method num_trees (line 4280) | def num_trees(self) -> int:
    method upper_bound (line 4297) | def upper_bound(self) -> float:
    method lower_bound (line 4314) | def lower_bound(self) -> float:
    method eval (line 4331) | def eval(
    method eval_train (line 4386) | def eval_train(
    method eval_valid (line 4420) | def eval_valid(
    method save_model (line 4458) | def save_model(
    method shuffle_models (line 4502) | def shuffle_models(
    method model_from_string (line 4531) | def model_from_string(self, model_str: str) -> "Booster":
    method model_to_string (line 4568) | def model_to_string(
    method dump_model (line 4632) | def dump_model(
    method predict (line 4711) | def predict(
    method refit (line 4788) | def refit(
    method get_leaf_output (line 4944) | def get_leaf_output(self, tree_id: int, leaf_id: int) -> float:
    method set_leaf_output (line 4970) | def set_leaf_output(
    method num_feature (line 5004) | def num_feature(self) -> int:
    method feature_name (line 5021) | def feature_name(self) -> List[str]:
    method feature_importance (line 5065) | def feature_importance(
    method get_split_value_histogram (line 5105) | def get_split_value_histogram(
    method __inner_eval (line 5179) | def __inner_eval(
    method __inner_predict (line 5225) | def __inner_predict(self, *, data_idx: int) -> np.ndarray:
    method __get_eval_info (line 5256) | def __get_eval_info(self) -> None:

FILE: python-package/lightgbm/callback.py
  class EarlyStopException (line 40) | class EarlyStopException(Exception):
    method __init__ (line 47) | def __init__(self, best_iteration: int, best_score: _ListOfEvalResultT...
  class CallbackEnv (line 65) | class CallbackEnv:
  function _is_using_cv (line 74) | def _is_using_cv(env: CallbackEnv) -> bool:
  function _format_eval_result (line 82) | def _format_eval_result(value: _EvalResultTuple, show_stdv: bool) -> str:
  class _LogEvaluationCallback (line 93) | class _LogEvaluationCallback:
    method __init__ (line 96) | def __init__(self, period: int = 1, show_stdv: bool = True) -> None:
    method __call__ (line 103) | def __call__(self, env: CallbackEnv) -> None:
  function log_evaluation (line 109) | def log_evaluation(period: int = 1, show_stdv: bool = True) -> _LogEvalu...
  class _RecordEvaluationCallback (line 135) | class _RecordEvaluationCallback:
    method __init__ (line 138) | def __init__(self, eval_result: _EvalResultDict) -> None:
    method _init (line 146) | def _init(self, env: CallbackEnv) -> None:
    method __call__ (line 162) | def __call__(self, env: CallbackEnv) -> None:
  function record_evaluation (line 183) | def record_evaluation(eval_result: Dict[str, Dict[str, List[Any]]]) -> C...
  class _ResetParameterCallback (line 219) | class _ResetParameterCallback:
    method __init__ (line 222) | def __init__(self, **kwargs: Union[list, Callable]) -> None:
    method __call__ (line 228) | def __call__(self, env: CallbackEnv) -> None:
  function reset_parameter (line 254) | def reset_parameter(**kwargs: Union[list, Callable]) -> Callable:
  class _EarlyStoppingCallback (line 278) | class _EarlyStoppingCallback:
    method __init__ (line 281) | def __init__(
    method _reset_storages (line 300) | def _reset_storages(self) -> None:
    method _gt_delta (line 307) | def _gt_delta(self, *, curr_score: float, best_score: float, delta: fl...
    method _lt_delta (line 310) | def _lt_delta(self, *, curr_score: float, best_score: float, delta: fl...
    method _is_train_set (line 313) | def _is_train_set(self, *, dataset_name: str, env: CallbackEnv) -> bool:
    method _init (line 326) | def _init(self, env: CallbackEnv) -> None:
    method _final_iteration_check (line 391) | def _final_iteration_check(self, *, env: CallbackEnv, metric_name: str...
    method __call__ (line 402) | def __call__(self, env: CallbackEnv) -> None:
  function _should_enable_early_stopping (line 444) | def _should_enable_early_stopping(stopping_rounds: Any) -> bool:
  function early_stopping (line 456) | def early_stopping(

FILE: python-package/lightgbm/compat.py
  function _check_sample_weight (line 42) | def _check_sample_weight(sample_weight: Any, X: Any, dtype: Any = None) ...
  function validate_data (line 51) | def validate_data(
  class _LGBMModelBase (line 132) | class _LGBMModelBase:  # type: ignore
  class _LGBMClassifierBase (line 137) | class _LGBMClassifierBase:  # type: ignore
  class _LGBMRegressorBase (line 142) | class _LGBMRegressorBase:  # type: ignore
  class pd_Series (line 183) | class pd_Series:  # type: ignore
    method __init__ (line 186) | def __init__(self, *args: Any, **kwargs: Any):
  class pd_DataFrame (line 189) | class pd_DataFrame:  # type: ignore
    method __init__ (line 192) | def __init__(self, *args: Any, **kwargs: Any):
  class pd_CategoricalDtype (line 195) | class pd_CategoricalDtype:  # type: ignore
    method __init__ (line 198) | def __init__(self, *args: Any, **kwargs: Any):
  class Client (line 249) | class Client:  # type: ignore
    method __init__ (line 252) | def __init__(self, *args: Any, **kwargs: Any):
  class Future (line 255) | class Future:  # type: ignore
    method __init__ (line 258) | def __init__(self, *args: Any, **kwargs: Any):
  class dask_Array (line 261) | class dask_Array:  # type: ignore
    method __init__ (line 264) | def __init__(self, *args: Any, **kwargs: Any):
  class dask_DataFrame (line 267) | class dask_DataFrame:  # type: ignore
    method __init__ (line 270) | def __init__(self, *args: Any, **kwargs: Any):
  class dask_Series (line 273) | class dask_Series:  # type: ignore
    method __init__ (line 276) | def __init__(self, *args: Any, **kwargs: Any):
  class pa_Array (line 296) | class pa_Array:  # type: ignore
    method __init__ (line 299) | def __init__(self, *args: Any, **kwargs: Any):
  class pa_ChunkedArray (line 302) | class pa_ChunkedArray:  # type: ignore
    method __init__ (line 305) | def __init__(self, *args: Any, **kwargs: Any):
  class pa_Table (line 308) | class pa_Table:  # type: ignore
    method __init__ (line 311) | def __init__(self, *args: Any, **kwargs: Any):
  class pa_compute (line 314) | class pa_compute:  # type: ignore
  class arrow_cffi (line 335) | class arrow_cffi:  # type: ignore
    method __init__ (line 340) | def __init__(self, *args: Any, **kwargs: Any):
  function _LGBMCpuCount (line 348) | def _LGBMCpuCount(only_physical_cores: bool = True) -> int:
  function _LGBMCpuCount (line 354) | def _LGBMCpuCount(only_physical_cores: bool = True) -> int:
  function _LGBMCpuCount (line 359) | def _LGBMCpuCount(only_physical_cores: bool = True) -> int:

FILE: python-package/lightgbm/dask.py
  class _RemoteSocket (line 67) | class _RemoteSocket:
    method acquire (line 68) | def acquire(self) -> int:
    method release (line 74) | def release(self) -> None:
  function _acquire_port (line 78) | def _acquire_port() -> Tuple[_RemoteSocket, int]:
  class _DatasetNames (line 84) | class _DatasetNames(Enum):
  function _get_dask_client (line 96) | def _get_dask_client(client: Optional[Client]) -> Client:
  function _assign_open_ports_to_workers (line 115) | def _assign_open_ports_to_workers(
  function _concat (line 152) | def _concat(seq: List[_DaskPart]) -> _DaskPart:
  function _remove_list_padding (line 165) | def _remove_list_padding(*args: Any) -> List[List[Any]]:
  function _pad_eval_names (line 169) | def _pad_eval_names(
  function _train_part (line 187) | def _train_part(
  function _split_to_parts (line 378) | def _split_to_parts(*, data: _DaskCollection, is_matrix: bool) -> List[_...
  function _machines_to_worker_map (line 389) | def _machines_to_worker_map(
  function _train (line 433) | def _train(
  function _predict_part (line 861) | def _predict_part(
  function _predict (line 910) | def _predict(
  class _DaskLGBMModel (line 1055) | class _DaskLGBMModel:
    method client_ (line 1057) | def client_(self) -> Client:
    method _lgb_dask_getstate (line 1068) | def _lgb_dask_getstate(self) -> Dict[Any, Any]:
    method _lgb_dask_fit (line 1077) | def _lgb_dask_fit(
    method _lgb_dask_to_local (line 1133) | def _lgb_dask_to_local(self, model_factory: Type[LGBMModel]) -> LGBMMo...
    method _lgb_dask_copy_extra_params (line 1142) | def _lgb_dask_copy_extra_params(
  class DaskLGBMClassifier (line 1154) | class DaskLGBMClassifier(LGBMClassifier, _DaskLGBMModel):
    method __init__ (line 1157) | def __init__(
    method __getstate__ (line 1215) | def __getstate__(self) -> Dict[Any, Any]:
    method fit (line 1218) | def fit(  # type: ignore[override]
    method predict (line 1282) | def predict(
    method predict_proba (line 1316) | def predict_proba(
    method to_local (line 1351) | def to_local(self) -> LGBMClassifier:
  class DaskLGBMRegressor (line 1362) | class DaskLGBMRegressor(LGBMRegressor, _DaskLGBMModel):
    method __init__ (line 1365) | def __init__(
    method __getstate__ (line 1423) | def __getstate__(self) -> Dict[Any, Any]:
    method fit (line 1426) | def fit(  # type: ignore[override]
    method predict (line 1490) | def predict(
    method to_local (line 1524) | def to_local(self) -> LGBMRegressor:
  class DaskLGBMRanker (line 1535) | class DaskLGBMRanker(LGBMRanker, _DaskLGBMModel):
    method __init__ (line 1538) | def __init__(
    method __getstate__ (line 1596) | def __getstate__(self) -> Dict[Any, Any]:
    method fit (line 1599) | def fit(  # type: ignore[override]
    method predict (line 1672) | def predict(
    method to_local (line 1706) | def to_local(self) -> LGBMRanker:

FILE: python-package/lightgbm/engine.py
  function _choose_num_iterations (line 53) | def _choose_num_iterations(*, num_boost_round_kwarg: int, params: Dict[s...
  function train (line 109) | def train(
  class CVBooster (line 356) | class CVBooster:
    method __init__ (line 376) | def __init__(
    method _from_dict (line 394) | def _from_dict(self, models: Dict[str, Any]) -> None:
    method _to_dict (line 401) | def _to_dict(
    method __getattr__ (line 418) | def __getattr__(self, name: str) -> Callable[[Any, Any], List[Any]]:
    method __getstate__ (line 430) | def __getstate__(self) -> Dict[str, Any]:
    method __setstate__ (line 433) | def __setstate__(self, state: Dict[str, Any]) -> None:
    method model_from_string (line 436) | def model_from_string(self, model_str: str) -> "CVBooster":
    method model_to_string (line 452) | def model_to_string(
    method save_model (line 482) | def save_model(
  function _make_n_folds (line 522) | def _make_n_folds(
  function _agg_cv_result (line 596) | def _agg_cv_result(
  function cv (line 627) | def cv(

FILE: python-package/lightgbm/libpath.py
  function _find_lib_path (line 13) | def _find_lib_path() -> List[str]:

FILE: python-package/lightgbm/plotting.py
  function _check_not_tuple_of_2_elements (line 27) | def _check_not_tuple_of_2_elements(obj: Any, obj_name: str) -> None:
  function _float2str (line 33) | def _float2str(value: float, precision: Optional[int]) -> str:
  function plot_importance (line 37) | def plot_importance(
  function plot_split_value_histogram (line 176) | def plot_split_value_histogram(
  function plot_metric (line 292) | def plot_metric(
  function _determine_direction_for_numeric_split (line 432) | def _determine_direction_for_numeric_split(
  function _determine_direction_for_categorical_split (line 451) | def _determine_direction_for_categorical_split(fval: float, thresholds: ...
  function _to_graphviz (line 458) | def _to_graphviz(
  function create_tree_digraph (line 621) | def create_tree_digraph(
  function plot_tree (line 747) | def plot_tree(

FILE: python-package/lightgbm/sklearn.py
  function _get_group_from_constructed_dataset (line 125) | def _get_group_from_constructed_dataset(dataset: Dataset) -> Optional[np...
  function _get_label_from_constructed_dataset (line 135) | def _get_label_from_constructed_dataset(dataset: Dataset) -> np.ndarray:
  function _get_weight_from_constructed_dataset (line 145) | def _get_weight_from_constructed_dataset(dataset: Dataset) -> Optional[n...
  class _ObjectiveFunctionWrapper (line 155) | class _ObjectiveFunctionWrapper:
    method __init__ (line 158) | def __init__(self, func: _LGBM_ScikitCustomObjectiveFunction):
    method __call__ (line 201) | def __call__(
  class _EvalFunctionWrapper (line 242) | class _EvalFunctionWrapper:
    method __init__ (line 245) | def __init__(self, func: _LGBM_ScikitCustomEvalFunction):
    method __call__ (line 284) | def __call__(
  function _extract_evaluation_meta_data (line 472) | def _extract_evaluation_meta_data(
  function _validate_eval_set_Xy (line 496) | def _validate_eval_set_Xy(
  class LGBMModel (line 532) | class LGBMModel(_LGBMModelBase):
    method __init__ (line 535) | def __init__(
    method _more_tags (line 720) | def _more_tags(self) -> Dict[str, Any]:
    method _update_sklearn_tags_from_dict (line 752) | def _update_sklearn_tags_from_dict(
    method __sklearn_tags__ (line 769) | def __sklearn_tags__(self) -> Optional["_sklearn_Tags"]:
    method __sklearn_is_fitted__ (line 786) | def __sklearn_is_fitted__(self) -> bool:
    method get_params (line 789) | def get_params(self, deep: bool = True) -> Dict[str, Any]:
    method set_params (line 835) | def set_params(self, **params: Any) -> "LGBMModel":
    method _process_params (line 855) | def _process_params(self, stage: str) -> Dict[str, Any]:
    method _process_n_jobs (line 941) | def _process_n_jobs(self, n_jobs: Optional[int]) -> int:
    method fit (line 961) | def fit(
    method predict (line 1159) | def predict(
    method n_features_ (line 1231) | def n_features_(self) -> int:
    method n_features_in_ (line 1238) | def n_features_in_(self) -> int:
    method n_features_in_ (line 1245) | def n_features_in_(self, value: int) -> None:
    method best_score_ (line 1260) | def best_score_(self) -> _LGBM_BoosterBestScoreType:
    method best_iteration_ (line 1267) | def best_iteration_(self) -> int:
    method objective_ (line 1276) | def objective_(self) -> Union[str, _LGBM_ScikitCustomObjectiveFunction]:
    method n_estimators_ (line 1283) | def n_estimators_(self) -> int:
    method n_iter_ (line 1296) | def n_iter_(self) -> int:
    method booster_ (line 1309) | def booster_(self) -> Booster:
    method evals_result_ (line 1316) | def evals_result_(self) -> _EvalResultDict:
    method feature_importances_ (line 1323) | def feature_importances_(self) -> np.ndarray:
    method feature_name_ (line 1336) | def feature_name_(self) -> List[str]:
    method feature_names_in_ (line 1348) | def feature_names_in_(self) -> np.ndarray:
    method feature_names_in_ (line 1358) | def feature_names_in_(self) -> None:
  class LGBMRegressor (line 1380) | class LGBMRegressor(_LGBMRegressorBase, LGBMModel):
    method __init__ (line 1385) | def __init__(
    method _more_tags (line 1434) | def _more_tags(self) -> Dict[str, Any]:
    method __sklearn_tags__ (line 1444) | def __sklearn_tags__(self) -> "_sklearn_Tags":
    method fit (line 1447) | def fit(  # type: ignore[override]
  class LGBMClassifier (line 1495) | class LGBMClassifier(_LGBMClassifierBase, LGBMModel):
    method __init__ (line 1500) | def __init__(
    method _more_tags (line 1549) | def _more_tags(self) -> Dict[str, Any]:
    method __sklearn_tags__ (line 1559) | def __sklearn_tags__(self) -> "_sklearn_Tags":
    method fit (line 1566) | def fit(  # type: ignore[override]
    method predict (line 1662) | def predict(
    method predict_proba (line 1692) | def predict_proba(
    method classes_ (line 1741) | def classes_(self) -> np.ndarray:
    method n_classes_ (line 1748) | def n_classes_(self) -> int:
    method __is_multiclass (line 1755) | def __is_multiclass(self) -> bool:
  class LGBMRanker (line 1760) | class LGBMRanker(LGBMModel):
    method __init__ (line 1772) | def __init__(
    method fit (line 1821) | def fit(  # type: ignore[override]

FILE: src/application/application.cpp
  type LightGBM (line 33) | namespace LightGBM {

FILE: src/application/predictor.hpp
  type LightGBM (line 26) | namespace LightGBM {
    class Predictor (line 31) | class Predictor {
      method Predictor (line 42) | Predictor(Boosting* boosting, int start_iteration, int num_iteration...
      method PredictFunction (line 151) | inline const PredictFunction& GetPredictFunction() const {
      method PredictSparseFunction (line 156) | inline const PredictSparseFunction& GetPredictSparseFunction() const {
      method Predict (line 165) | void Predict(const char* data_filename, const char* result_filename,...
      method CopyToPredictBuffer (line 260) | void CopyToPredictBuffer(double* pred_buf, const std::vector<std::pa...
      method ClearPredictBuffer (line 268) | void ClearPredictBuffer(double* pred_buf, size_t buf_size, const std...
      method CopyToPredictMap (line 280) | std::unordered_map<int, double> CopyToPredictMap(const std::vector<s...

FILE: src/boosting/bagging.hpp
  type LightGBM (line 13) | namespace LightGBM {
    class BaggingSampleStrategy (line 15) | class BaggingSampleStrategy : public SampleStrategy {
      method BaggingSampleStrategy (line 17) | BaggingSampleStrategy(const Config* config, const Dataset* train_dat...
      method Bagging (line 31) | void Bagging(int iter, TreeLearner* tree_learner, score_t* /*gradien...
      method ResetSampleConfig (line 140) | void ResetSampleConfig(const Config* config, bool is_change_dataset)...
      method IsHessianChange (line 218) | bool IsHessianChange() const override {
      method data_size_t (line 222) | data_size_t num_sampled_queries() const override {
      method data_size_t (line 226) | const data_size_t* sampled_query_indices() const override {
      method data_size_t (line 231) | data_size_t BaggingHelper(data_size_t start, data_size_t cnt, data_s...
      method data_size_t (line 249) | data_size_t BalancedBaggingHelper(data_size_t start, data_size_t cnt...

FILE: src/boosting/boosting.cpp
  type LightGBM (line 19) | namespace LightGBM {
    function GetBoostingTypeFromModelFile (line 21) | std::string GetBoostingTypeFromModelFile(const char* filename) {
    function Boosting (line 42) | Boosting* Boosting::CreateBoosting(const std::string& type, const char...

FILE: src/boosting/cuda/cuda_score_updater.cpp
  type LightGBM (line 11) | namespace LightGBM {

FILE: src/boosting/cuda/cuda_score_updater.hpp
  type LightGBM (line 16) | namespace LightGBM {
    class CUDAScoreUpdater (line 18) | class CUDAScoreUpdater: public ScoreUpdater {
      method CUDAScoreUpdater (line 44) | CUDAScoreUpdater& operator=(const CUDAScoreUpdater&) = delete;
      method CUDAScoreUpdater (line 46) | CUDAScoreUpdater(const CUDAScoreUpdater&) = delete;

FILE: src/boosting/cuda/nccl_gbdt.cpp
  type LightGBM (line 17) | namespace LightGBM {
    class NCCLGBDT<GBDT> (line 206) | class NCCLGBDT<GBDT>

FILE: src/boosting/cuda/nccl_gbdt.hpp
  type LightGBM (line 27) | namespace LightGBM {
    class NCCLGBDT (line 30) | class NCCLGBDT: public GBDT_T {
      method RefitTree (line 42) | void RefitTree(const int* /*tree_leaf_prediction*/, const size_t /*n...
      method ResetTrainingData (line 52) | void ResetTrainingData(const Dataset* /*train_data*/, const Objectiv...
      method ResetConfig (line 57) | void ResetConfig(const Config* /*gbdt_config*/) override {
      type BoostingThreadData (line 62) | struct BoostingThreadData {
        method BoostingThreadData (line 69) | BoostingThreadData() {
      type TrainTreeLearnerThreadData (line 75) | struct TrainTreeLearnerThreadData {
        method TrainTreeLearnerThreadData (line 85) | TrainTreeLearnerThreadData() {
      type UpdateScoreThreadData (line 97) | struct UpdateScoreThreadData {
        method UpdateScoreThreadData (line 104) | UpdateScoreThreadData() {
      method UpdateScore (line 123) | void UpdateScore(const Tree* /*tree*/, const int /*cur_tree_id*/) {
      method RollbackOneIter (line 127) | void RollbackOneIter() override {

FILE: src/boosting/cuda/nccl_gbdt_component.hpp
  type LightGBM (line 23) | namespace LightGBM {
    class NCCLGBDTComponent (line 25) | class NCCLGBDTComponent: public NCCLInfo {
      method NCCLGBDTComponent (line 27) | NCCLGBDTComponent() {}
      method Init (line 31) | void Init(const Config* config, const Dataset* train_data, const int...
      method ObjectiveFunction (line 60) | ObjectiveFunction* objective_function() { return objective_function_...
      method ScoreUpdater (line 62) | ScoreUpdater* train_score_updater() { return train_score_updater_.ge...
      method score_t (line 64) | score_t* gradients() { return gradients_->RawData(); }
      method score_t (line 66) | score_t* hessians() { return hessians_->RawData(); }
      method data_size_t (line 68) | data_size_t num_data_in_gpu() const { return num_data_in_gpu_; }
      method CUDASingleGPUTreeLearner (line 70) | CUDASingleGPUTreeLearner* tree_learner() { return tree_learner_.get(...
      method SetTree (line 72) | void SetTree(Tree* tree) {
      method data_size_t (line 76) | data_size_t data_start_index() const { return data_start_index_; }
      method data_size_t (line 78) | data_size_t data_end_index() const { return data_end_index_; }
      method Tree (line 80) | Tree* new_tree() { return new_tree_.get(); }
      method Tree (line 82) | Tree* release_new_tree() { return new_tree_.release(); }
      method clear_new_tree (line 84) | void clear_new_tree() { new_tree_.reset(nullptr); }

FILE: src/boosting/dart.hpp
  type LightGBM (line 20) | namespace LightGBM {
    class DART (line 24) | class DART: public GBDT {
      method DART (line 29) | DART() : GBDT() { }
      method Init (line 42) | void Init(const Config* config, const Dataset* train_data,
      method ResetConfig (line 50) | void ResetConfig(const Config* config) override {
      method TrainOneIter (line 59) | bool TrainOneIter(const score_t* gradient, const score_t* hessian) o...
      method EvalAndCheckEarlyStopping (line 89) | bool EvalAndCheckEarlyStopping() override {
      method DroppingTrees (line 98) | void DroppingTrees() {
      method Normalize (line 159) | void Normalize() {

FILE: src/boosting/gbdt.cpp
  function ObtainAutomaticInitialScore (line 317) | double ObtainAutomaticInitialScore(const ObjectiveFunction* fobj, int cl...

FILE: src/boosting/gbdt.h
  function namespace (line 31) | namespace LightGBM {

FILE: src/boosting/gbdt_model_text.cpp
  type LightGBM (line 21) | namespace LightGBM {

FILE: src/boosting/gbdt_prediction.cpp
  type LightGBM (line 14) | namespace LightGBM {

FILE: src/boosting/goss.hpp
  type LightGBM (line 17) | namespace LightGBM {
    class GOSSStrategy (line 19) | class GOSSStrategy : public SampleStrategy {
      method GOSSStrategy (line 21) | GOSSStrategy(const Config* config, const Dataset* train_data, int nu...
      method Bagging (line 31) | void Bagging(int iter, TreeLearner* tree_learner, score_t* gradients...
      method ResetSampleConfig (line 79) | void ResetSampleConfig(const Config* config, bool /*is_change_datase...
      method IsHessianChange (line 114) | bool IsHessianChange() const override {
      method data_size_t (line 119) | data_size_t Helper(data_size_t start, data_size_t cnt, data_size_t* ...

FILE: src/boosting/prediction_early_stop.cpp
  type LightGBM (line 17) | namespace LightGBM {
    function PredictionEarlyStopInstance (line 19) | PredictionEarlyStopInstance CreateNone(const PredictionEarlyStopConfig...
    function PredictionEarlyStopInstance (line 28) | PredictionEarlyStopInstance CreateMulticlass(const PredictionEarlyStop...
    function PredictionEarlyStopInstance (line 57) | PredictionEarlyStopInstance CreateBinary(const PredictionEarlyStopConf...
    function PredictionEarlyStopInstance (line 78) | PredictionEarlyStopInstance CreatePredictionEarlyStopInstance(const st...

FILE: src/boosting/rf.hpp
  type LightGBM (line 22) | namespace LightGBM {
    class RF (line 26) | class RF : public GBDT {
      method RF (line 28) | RF() : GBDT() {
      method Init (line 34) | void Init(const Config* config, const Dataset* train_data, const Obj...
      method ResetConfig (line 62) | void ResetConfig(const Config* config) override {
      method ResetTrainingData (line 74) | void ResetTrainingData(const Dataset* train_data, const ObjectiveFun...
      method Boosting (line 91) | void Boosting() override {
      method TrainOneIter (line 112) | bool TrainOneIter(const score_t* gradients, const score_t* hessians)...
      method RollbackOneIter (line 185) | void RollbackOneIter() override {
      method MultiplyScore (line 208) | void MultiplyScore(const int cur_tree_id, double val) {
      method AddValidDataset (line 215) | void AddValidDataset(const Dataset* valid_data,
      method NeedAccuratePrediction (line 225) | bool NeedAccuratePrediction() const override {

FILE: src/boosting/sample_strategy.cpp
  type LightGBM (line 14) | namespace LightGBM {
    function SampleStrategy (line 16) | SampleStrategy* SampleStrategy::CreateSampleStrategy(

FILE: src/boosting/score_updater.hpp
  type LightGBM (line 18) | namespace LightGBM {
    class ScoreUpdater (line 22) | class ScoreUpdater {
      method ScoreUpdater (line 28) | ScoreUpdater(const Dataset* data, int num_tree_per_iteration) : data...
      method has_init_score (line 53) | inline bool has_init_score() const { return has_init_score_; }
      method AddScore (line 55) | virtual inline void AddScore(double val, int cur_tree_id) {
      method MultiplyScore (line 64) | virtual inline void MultiplyScore(double val, int cur_tree_id) {
      method AddScore (line 77) | virtual inline void AddScore(const Tree* tree, int cur_tree_id) {
      method AddScore (line 89) | virtual inline void AddScore(const TreeLearner* tree_learner, const ...
      method AddScore (line 102) | virtual inline void AddScore(const Tree* tree, const data_size_t* da...
      method data_size_t (line 111) | inline data_size_t num_data() const { return num_data_; }
      method ScoreUpdater (line 114) | ScoreUpdater& operator=(const ScoreUpdater&) = delete;
      method ScoreUpdater (line 116) | ScoreUpdater(const ScoreUpdater&) = delete;

FILE: src/c_api.cpp
  type LightGBM (line 40) | namespace LightGBM {
    function LGBM_APIHandleException (line 42) | inline int LGBM_APIHandleException(const std::exception& ex) {
    function LGBM_APIHandleException (line 46) | inline int LGBM_APIHandleException(const std::string& ex) {
    class SingleRowPredictorInner (line 67) | class SingleRowPredictorInner {
      method SingleRowPredictorInner (line 72) | SingleRowPredictorInner(int predict_type, Boosting* boosting, const ...
      method IsPredictorEqual (line 96) | bool IsPredictorEqual(const Config& config, int iter, Boosting* boos...
    type SingleRowPredictor (line 121) | struct SingleRowPredictor {
      method SingleRowPredictor (line 123) | SingleRowPredictor(yamc::alternate::shared_mutex *booster_mutex,
      method Predict (line 137) | void Predict(std::function<std::vector<std::pair<int, double>>(int r...
    class Booster (line 167) | class Booster {
      method Booster (line 169) | explicit Booster(const char* filename) {
      method Booster (line 173) | Booster(const Dataset* train_data,
      method MergeFrom (line 200) | void MergeFrom(const Booster* other) {
      method CreateObjectiveAndMetrics (line 208) | void CreateObjectiveAndMetrics() {
      method ResetTrainingData (line 234) | void ResetTrainingData(const Dataset* train_data) {
      method CheckDatasetResetConfig (line 245) | static void CheckDatasetResetConfig(
      method ResetConfig (line 360) | void ResetConfig(const char* parameters) {
      method AddValidData (line 398) | void AddValidData(const Dataset* valid_data) {
      method TrainOneIter (line 414) | bool TrainOneIter() {
      method Refit (line 419) | void Refit(const int32_t* leaf_preds, int32_t nrow, int32_t ncol) {
      method TrainOneIter (line 424) | bool TrainOneIter(const score_t* gradients, const score_t* hessians) {
      method RollbackOneIter (line 429) | void RollbackOneIter() {
      method SetSingleRowPredictorInner (line 434) | void SetSingleRowPredictorInner(int start_iteration, int num_iterati...
      method InitSingleRowPredictor (line 443) | std::unique_ptr<SingleRowPredictor> InitSingleRowPredictor(int predi...
      method PredictSingleRow (line 454) | void PredictSingleRow(int predict_type, int ncol,
      method CreatePredictor (line 471) | std::shared_ptr<Predictor> CreatePredictor(int start_iteration, int ...
      method Predict (line 493) | void Predict(int start_iteration, int num_iteration, int predict_typ...
      method PredictSparse (line 521) | void PredictSparse(int start_iteration, int num_iteration, int predi...
      method PredictSparseCSR (line 563) | void PredictSparseCSR(int start_iteration, int num_iteration, int pr...
      method PredictSparseCSC (line 654) | void PredictSparseCSC(int start_iteration, int num_iteration, int pr...
      method Predict (line 763) | void Predict(int start_iteration, int num_iteration, int predict_typ...
      method GetPredictAt (line 786) | void GetPredictAt(int data_idx, double* out_result, int64_t* out_len...
      method SaveModelToFile (line 790) | void SaveModelToFile(int start_iteration, int num_iteration, int fea...
      method LoadModelFromString (line 794) | void LoadModelFromString(const char* model_str) {
      method SaveModelToString (line 799) | std::string SaveModelToString(int start_iteration, int num_iteration,
      method DumpModel (line 805) | std::string DumpModel(int start_iteration, int num_iteration,
      method FeatureImportance (line 811) | std::vector<double> FeatureImportance(int num_iteration, int importa...
      method UpperBoundValue (line 815) | double UpperBoundValue() const {
      method LowerBoundValue (line 820) | double LowerBoundValue() const {
      method GetLeafValue (line 825) | double GetLeafValue(int tree_idx, int leaf_idx) const {
      method SetLeafValue (line 830) | void SetLeafValue(int tree_idx, int leaf_idx, double val) {
      method ShuffleModels (line 835) | void ShuffleModels(int start_iter, int end_iter) {
      method GetEvalCounts (line 840) | int GetEvalCounts() const {
      method GetEvalNames (line 849) | int GetEvalNames(char** out_strs, const int len, const size_t buffer...
      method GetFeatureNames (line 866) | int GetFeatureNames(char** out_strs, const int len, const size_t buf...
      method Boosting (line 881) | const Boosting* GetBoosting() const { return boosting_.get(); }
  class CSC_RowIterator (line 940) | class CSC_RowIterator {
  function LGBM_DumpParamAliases (line 964) | int LGBM_DumpParamAliases(int64_t buffer_len,
  function LGBM_RegisterLogCallback (line 976) | int LGBM_RegisterLogCallback(void (*callback)(const char*)) {
  function SampleCount (line 982) | static inline int SampleCount(int32_t total_nrow, const Config& config) {
  function CreateSampleIndices (line 986) | static inline std::vector<int32_t> CreateSampleIndices(int32_t total_nro...
  function LGBM_GetSampleCount (line 992) | int LGBM_GetSampleCount(int32_t num_total_row,
  function LGBM_SampleIndices (line 1007) | int LGBM_SampleIndices(int32_t num_total_row,
  function LGBM_ByteBufferGetAt (line 1027) | int LGBM_ByteBufferGetAt(ByteBufferHandle handle, int32_t index, uint8_t...
  function LGBM_ByteBufferFree (line 1034) | int LGBM_ByteBufferFree(ByteBufferHandle handle) {
  function LGBM_DatasetCreateFromFile (line 1040) | int LGBM_DatasetCreateFromFile(const char* filename,
  function LGBM_DatasetCreateFromSampledColumn (line 1063) | int LGBM_DatasetCreateFromSampledColumn(double** sample_data,
  function LGBM_DatasetCreateByReference (line 1088) | int LGBM_DatasetCreateByReference(const DatasetHandle reference,
  function LGBM_DatasetCreateFromSerializedReference (line 1102) | int LGBM_DatasetCreateFromSerializedReference(const void* ref_buffer,
  function LGBM_DatasetInitStreaming (line 1121) | int LGBM_DatasetInitStreaming(DatasetHandle dataset,
  function LGBM_DatasetPushRows (line 1136) | int LGBM_DatasetPushRows(DatasetHandle dataset,
  function LGBM_DatasetPushRowsWithMetadata (line 1164) | int LGBM_DatasetPushRowsWithMetadata(DatasetHandle dataset,
  function LGBM_DatasetPushRowsByCSR (line 1210) | int LGBM_DatasetPushRowsByCSR(DatasetHandle dataset,
  function LGBM_DatasetPushRowsByCSRWithMetadata (line 1243) | int LGBM_DatasetPushRowsByCSRWithMetadata(DatasetHandle dataset,
  function LGBM_DatasetSetWaitForManualFinish (line 1293) | int LGBM_DatasetSetWaitForManualFinish(DatasetHandle dataset, int wait) {
  function LGBM_DatasetMarkFinished (line 1300) | int LGBM_DatasetMarkFinished(DatasetHandle dataset) {
  function LGBM_DatasetCreateFromMat (line 1307) | int LGBM_DatasetCreateFromMat(const void* data,
  function LGBM_DatasetCreateFromMats (line 1326) | int LGBM_DatasetCreateFromMats(int32_t nmat,
  function LGBM_DatasetCreateFromCSR (line 1411) | int LGBM_DatasetCreateFromCSR(const void* indptr,
  function LGBM_DatasetCreateFromCSRFunc (line 1483) | int LGBM_DatasetCreateFromCSRFunc(void* get_row_funptr,
  function LGBM_DatasetCreateFromCSC (line 1556) | int LGBM_DatasetCreateFromCSC(const void* col_ptr,
  function LGBM_DatasetCreateFromArrow (line 1646) | int LGBM_DatasetCreateFromArrow(int64_t n_chunks,
  function LGBM_DatasetGetSubset (line 1738) | int LGBM_DatasetGetSubset(
  function LGBM_DatasetSetFeatureNames (line 1764) | int LGBM_DatasetSetFeatureNames(
  function LGBM_DatasetGetFeatureNames (line 1778) | int LGBM_DatasetGetFeatureNames(
  function LGBM_DatasetFree (line 1803) | int LGBM_DatasetFree(DatasetHandle handle) {
  function LGBM_DatasetSaveBinary (line 1809) | int LGBM_DatasetSaveBinary(DatasetHandle handle,
  function LGBM_DatasetSerializeReferenceToBinary (line 1817) | int LGBM_DatasetSerializeReferenceToBinary(DatasetHandle handle,
  function LGBM_DatasetDumpText (line 1830) | int LGBM_DatasetDumpText(DatasetHandle handle,
  function LGBM_DatasetSetField (line 1838) | int LGBM_DatasetSetField(DatasetHandle handle,
  function LGBM_DatasetSetFieldFromArrow (line 1859) | int LGBM_DatasetSetFieldFromArrow(DatasetHandle handle,
  function LGBM_DatasetGetField (line 1874) | int LGBM_DatasetGetField(DatasetHandle handle,
  function LGBM_DatasetUpdateParamChecking (line 1901) | int LGBM_DatasetUpdateParamChecking(const char* old_parameters, const ch...
  function LGBM_DatasetGetNumData (line 1911) | int LGBM_DatasetGetNumData(DatasetHandle handle,
  function LGBM_DatasetGetNumFeature (line 1919) | int LGBM_DatasetGetNumFeature(DatasetHandle handle,
  function LGBM_DatasetGetFeatureNumBin (line 1927) | int LGBM_DatasetGetFeatureNumBin(DatasetHandle handle,
  function LGBM_DatasetAddFeaturesFrom (line 1946) | int LGBM_DatasetAddFeaturesFrom(DatasetHandle target,
  function LGBM_BoosterCreate (line 1957) | int LGBM_BoosterCreate(const DatasetHandle train_data,
  function LGBM_BoosterCreateFromModelfile (line 1967) | int LGBM_BoosterCreateFromModelfile(
  function LGBM_BoosterLoadModelFromString (line 1978) | int LGBM_BoosterLoadModelFromString(
  function LGBM_BoosterGetLoadedParam (line 1990) | int LGBM_BoosterGetLoadedParam(
  function LGBM_BoosterFree (line 2008) | int LGBM_BoosterFree(BoosterHandle handle) {
  function LGBM_BoosterShuffleModels (line 2014) | int LGBM_BoosterShuffleModels(BoosterHandle handle, int start_iter, int ...
  function LGBM_BoosterMerge (line 2021) | int LGBM_BoosterMerge(BoosterHandle handle,
  function LGBM_BoosterAddValidData (line 2030) | int LGBM_BoosterAddValidData(BoosterHandle handle,
  function LGBM_BoosterResetTrainingData (line 2039) | int LGBM_BoosterResetTrainingData(BoosterHandle handle,
  function LGBM_BoosterResetParameter (line 2048) | int LGBM_BoosterResetParameter(BoosterHandle handle, const char* paramet...
  function LGBM_BoosterGetNumClasses (line 2055) | int LGBM_BoosterGetNumClasses(BoosterHandle handle, int* out_len) {
  function LGBM_BoosterGetLinear (line 2062) | int LGBM_BoosterGetLinear(BoosterHandle handle, int* out) {
  function LGBM_BoosterRefit (line 2073) | int LGBM_BoosterRefit(BoosterHandle handle, const int32_t* leaf_preds, i...
  function LGBM_BoosterUpdateOneIter (line 2080) | int LGBM_BoosterUpdateOneIter(BoosterHandle handle, int* produced_empty_...
  function LGBM_BoosterUpdateOneIterCustom (line 2091) | int LGBM_BoosterUpdateOneIterCustom(BoosterHandle handle,
  function LGBM_BoosterRollbackOneIter (line 2113) | int LGBM_BoosterRollbackOneIter(BoosterHandle handle) {
  function LGBM_BoosterGetCurrentIteration (line 2120) | int LGBM_BoosterGetCurrentIteration(BoosterHandle handle, int* out_itera...
  function LGBM_BoosterNumModelPerIteration (line 2127) | int LGBM_BoosterNumModelPerIteration(BoosterHandle handle, int* out_tree...
  function LGBM_BoosterNumberOfTotalModel (line 2134) | int LGBM_BoosterNumberOfTotalModel(BoosterHandle handle, int* out_models) {
  function LGBM_BoosterGetEvalCounts (line 2141) | int LGBM_BoosterGetEvalCounts(BoosterHandle handle, int* out_len) {
  function LGBM_BoosterGetEvalNames (line 2148) | int LGBM_BoosterGetEvalNames(BoosterHandle handle,
  function LGBM_BoosterGetFeatureNames (line 2160) | int LGBM_BoosterGetFeatureNames(BoosterHandle handle,
  function LGBM_BoosterGetNumFeature (line 2172) | int LGBM_BoosterGetNumFeature(BoosterHandle handle, int* out_len) {
  function LGBM_BoosterGetEval (line 2179) | int LGBM_BoosterGetEval(BoosterHandle handle,
  function LGBM_BoosterGetNumPredict (line 2194) | int LGBM_BoosterGetNumPredict(BoosterHandle handle,
  function LGBM_BoosterGetPredict (line 2203) | int LGBM_BoosterGetPredict(BoosterHandle handle,
  function LGBM_BoosterPredictForFile (line 2213) | int LGBM_BoosterPredictForFile(BoosterHandle handle,
  function LGBM_BoosterCalcNumPredict (line 2232) | int LGBM_BoosterCalcNumPredict(BoosterHandle handle,
  function LGBM_FastConfigFree (line 2251) | int LGBM_FastConfigFree(FastConfigHandle fastConfig) {
  function LGBM_BoosterPredictForCSR (line 2257) | int LGBM_BoosterPredictForCSR(BoosterHandle handle,
  function LGBM_BoosterPredictSparseOutput (line 2290) | int LGBM_BoosterPredictSparseOutput(BoosterHandle handle,
  function LGBM_BoosterFreePredictSparse (line 2354) | int LGBM_BoosterFreePredictSparse(void* indptr, int32_t* indices, void* ...
  function LGBM_BoosterPredictForCSRSingleRow (line 2374) | int LGBM_BoosterPredictForCSRSingleRow(BoosterHandle handle,
  function LGBM_BoosterPredictForCSRSingleRowFastInit (line 2406) | int LGBM_BoosterPredictForCSRSingleRowFastInit(BoosterHandle handle,
  function LGBM_BoosterPredictForCSRSingleRowFast (line 2432) | int LGBM_BoosterPredictForCSRSingleRowFast(FastConfigHandle fastConfig_h...
  function LGBM_BoosterPredictForCSC (line 2449) | int LGBM_BoosterPredictForCSC(BoosterHandle handle,
  function LGBM_BoosterValidateFeatureNames (line 2496) | int LGBM_BoosterValidateFeatureNames(BoosterHandle handle,
  function LGBM_BoosterPredictForMat (line 2517) | int LGBM_BoosterPredictForMat(BoosterHandle handle,
  function LGBM_BoosterPredictForMatSingleRow (line 2541) | int LGBM_BoosterPredictForMatSingleRow(BoosterHandle handle,
  function LGBM_BoosterPredictForMatSingleRowFastInit (line 2564) | int LGBM_BoosterPredictForMatSingleRowFastInit(BoosterHandle handle,
  function LGBM_BoosterPredictForMatSingleRowFast (line 2584) | int LGBM_BoosterPredictForMatSingleRowFast(FastConfigHandle fastConfig_h...
  function LGBM_BoosterPredictForMats (line 2597) | int LGBM_BoosterPredictForMats(BoosterHandle handle,
  function LGBM_BoosterPredictForArrow (line 2619) | int LGBM_BoosterPredictForArrow(BoosterHandle handle,
  function LGBM_BoosterSaveModel (line 2670) | int LGBM_BoosterSaveModel(BoosterHandle handle,
  function LGBM_BoosterSaveModelToString (line 2682) | int LGBM_BoosterSaveModelToString(BoosterHandle handle,
  function LGBM_BoosterDumpModel (line 2700) | int LGBM_BoosterDumpModel(BoosterHandle handle,
  function LGBM_BoosterGetLeafValue (line 2718) | int LGBM_BoosterGetLeafValue(BoosterHandle handle,
  function LGBM_BoosterSetLeafValue (line 2728) | int LGBM_BoosterSetLeafValue(BoosterHandle handle,
  function LGBM_BoosterFeatureImportance (line 2738) | int LGBM_BoosterFeatureImportance(BoosterHandle handle,
  function LGBM_BoosterGetUpperBoundValue (line 2751) | int LGBM_BoosterGetUpperBoundValue(BoosterHandle handle,
  function LGBM_BoosterGetLowerBoundValue (line 2760) | int LGBM_BoosterGetLowerBoundValue(BoosterHandle handle,
  function LGBM_NetworkInit (line 2769) | int LGBM_NetworkInit(const char* machines,
  function LGBM_NetworkFree (line 2785) | int LGBM_NetworkFree() {
  function LGBM_NetworkInitWithFunctions (line 2791) | int LGBM_NetworkInitWithFunctions(int num_machines, int rank,
  function LGBM_SetMaxThreads (line 2801) | int LGBM_SetMaxThreads(int num_threads) {
  function LGBM_GetMaxThreads (line 2811) | int LGBM_GetMaxThreads(int* out) {
  function RowFunctionFromDenseMatrix_helper (line 2822) | std::function<std::vector<double>(int row_idx)>
  function RowFunctionFromDenseMatrix (line 2845) | std::function<std::vector<double>(int row_idx)>
  function RowPairFunctionFromDenseMatrix (line 2856) | std::function<std::vector<std::pair<int, double>>(int row_idx)>
  function RowPairFunctionFromDenseRows (line 2876) | std::function<std::vector<std::pair<int, double>>(int row_idx)>
  function RowFunctionFromCSR_helper (line 2893) | std::function<std::vector<std::pair<int, double>>(T idx)>
  function RowFunctionFromCSR (line 2912) | std::function<std::vector<std::pair<int, double>>(T idx)>
  function IterateFunctionFromCSC_helper (line 2934) | std::function<std::pair<int, double>(int idx)> IterateFunctionFromCSC_he...
  function IterateFunctionFromCSC (line 2950) | std::function<std::pair<int, double>(int idx)>

FILE: src/cuda/cuda_utils.cpp
  type LightGBM (line 12) | namespace LightGBM {
    function SynchronizeCUDADevice (line 14) | void SynchronizeCUDADevice(const char* file, const int line) {
    function SynchronizeCUDAStream (line 18) | void SynchronizeCUDAStream(cudaStream_t cuda_stream, const char* file,...
    function PrintLastCUDAError (line 22) | void PrintLastCUDAError() {
    function SetCUDADevice (line 27) | void SetCUDADevice(int gpu_device_id, const char* file, int line) {
    function GetCUDADevice (line 35) | int GetCUDADevice(const char* file, int line) {
    function cudaStream_t (line 41) | cudaStream_t CUDAStreamCreate() {
    function CUDAStreamDestroy (line 47) | void CUDAStreamDestroy(cudaStream_t cuda_stream) {
    function NCCLGroupStart (line 51) | void NCCLGroupStart() {
    function NCCLGroupEnd (line 55) | void NCCLGroupEnd() {

FILE: src/io/bin.cpp
  type LightGBM (line 24) | namespace LightGBM {
    function NeedFilter (line 57) | bool NeedFilter(const std::vector<int>& cnt_in_bin, int total_cnt, int...
    function GreedyFindBin (line 81) | std::vector<double> GreedyFindBin(const double* distinct_values, const...
    function FindBinWithPredefinedBin (line 162) | std::vector<double> FindBinWithPredefinedBin(const double* distinct_va...
    function FindBinWithZeroAsOneBin (line 247) | std::vector<double> FindBinWithZeroAsOneBin(const double* distinct_val...
    function FindBinWithZeroAsOneBin (line 305) | std::vector<double> FindBinWithZeroAsOneBin(const double* distinct_val...
    class DenseBin<uint8_t, true> (line 605) | class DenseBin<uint8_t, true>
    class DenseBin<uint8_t, false> (line 606) | class DenseBin<uint8_t, false>
    class DenseBin<uint16_t, false> (line 607) | class DenseBin<uint16_t, false>
    class DenseBin<uint32_t, false> (line 608) | class DenseBin<uint32_t, false>
    class SparseBin<uint8_t> (line 610) | class SparseBin<uint8_t>
    class SparseBin<uint16_t> (line 611) | class SparseBin<uint16_t>
    class SparseBin<uint32_t> (line 612) | class SparseBin<uint32_t>
    class MultiValDenseBin<uint8_t> (line 614) | class MultiValDenseBin<uint8_t>
    class MultiValDenseBin<uint16_t> (line 615) | class MultiValDenseBin<uint16_t>
    class MultiValDenseBin<uint32_t> (line 616) | class MultiValDenseBin<uint32_t>
    function Bin (line 618) | Bin* Bin::CreateDenseBin(data_size_t num_data, int num_bin) {
    function Bin (line 630) | Bin* Bin::CreateSparseBin(data_size_t num_data, int num_bin) {
    function MultiValBin (line 640) | MultiValBin* MultiValBin::CreateMultiValBin(data_size_t num_data, int ...
    function MultiValBin (line 651) | MultiValBin* MultiValBin::CreateMultiValDenseBin(data_size_t num_data,
    function MultiValBin (line 672) | MultiValBin* MultiValBin::CreateMultiValSparseBin(data_size_t num_data,

FILE: src/io/config.cpp
  type LightGBM (line 21) | namespace LightGBM {
    function GetFirstValueAsInt (line 39) | void GetFirstValueAsInt(const std::unordered_map<std::string, std::vec...
    function GetBoostingType (line 106) | void GetBoostingType(const std::unordered_map<std::string, std::string...
    function GetDataSampleStrategy (line 124) | void GetDataSampleStrategy(const std::unordered_map<std::string, std::...
    function ParseMetrics (line 138) | void ParseMetrics(const std::string& value, std::vector<std::string>* ...
    function GetObjectiveType (line 151) | void GetObjectiveType(const std::unordered_map<std::string, std::strin...
    function GetMetricType (line 159) | void GetMetricType(const std::unordered_map<std::string, std::string>&...
    function GetTaskType (line 171) | void GetTaskType(const std::unordered_map<std::string, std::string>& p...
    function GetDeviceType (line 192) | void GetDeviceType(const std::unordered_map<std::string, std::string>&...
    function GetTreeLearnerType (line 208) | void GetTreeLearnerType(const std::unordered_map<std::string, std::str...
    function CheckMultiClassObjective (line 317) | bool CheckMultiClassObjective(const std::string& objective) {

FILE: src/io/config_auto.cpp
  type LightGBM (line 16) | namespace LightGBM {

FILE: src/io/cuda/cuda_column_data.cpp
  type LightGBM (line 14) | namespace LightGBM {

FILE: src/io/cuda/cuda_metadata.cpp
  type LightGBM (line 13) | namespace LightGBM {

FILE: src/io/cuda/cuda_row_data.cpp
  type LightGBM (line 13) | namespace LightGBM {
    function BIN_TYPE (line 380) | const BIN_TYPE* CUDARowData::GetBin() const {
    function PTR_TYPE (line 399) | const PTR_TYPE* CUDARowData::GetRowPtr() const {
    function PTR_TYPE (line 418) | const PTR_TYPE* CUDARowData::GetPartitionPtr() const {

FILE: src/io/cuda/cuda_tree.cpp
  type LightGBM (line 11) | namespace LightGBM {

FILE: src/io/dataset.cpp
  type LightGBM (line 27) | namespace LightGBM {
    function OneFeaturePerGroup (line 56) | std::vector<std::vector<int>> OneFeaturePerGroup(const std::vector<int...
    function GetConflictCount (line 65) | int GetConflictCount(const std::vector<bool>& mark, const int* indices,
    function MarkUsed (line 79) | void MarkUsed(std::vector<bool>* mark, const int* indices,
    function FixSampleIndices (line 87) | std::vector<int> FixSampleIndices(const BinMapper* bin_mapper,
    function FindGroups (line 112) | std::vector<std::vector<int>> FindGroups(
    function FastFeatureBundling (line 251) | std::vector<std::vector<int>> FastFeatureBundling(
    function PushDataToMultiValBin (line 470) | void PushDataToMultiValBin(
    function MultiValBin (line 521) | MultiValBin* Dataset::GetMultiBinFromSparseFeatures(const std::vector<...
    function MultiValBin (line 565) | MultiValBin* Dataset::GetMultiBinFromAllFeatures(const std::vector<uin...
    function TrainingShareStates (line 617) | TrainingShareStates* Dataset::GetShareStates(
    function PushVector (line 1584) | void PushVector(std::vector<T>* dest, const std::vector<T>& src) {
    function PushOffset (line 1592) | void PushOffset(std::vector<T>* dest, const std::vector<T>& src,
    function PushClearIfEmpty (line 1601) | void PushClearIfEmpty(std::vector<T>* dest, const size_t dest_len,

FILE: src/io/dataset_loader.cpp
  type LightGBM (line 24) | namespace LightGBM {
    function CheckSampleSize (line 201) | void CheckSampleSize(size_t sample_cnt, size_t num_data) {
    function Dataset (line 211) | Dataset* DatasetLoader::LoadFromFile(const char* filename, int rank, i...
    function Dataset (line 307) | Dataset* DatasetLoader::LoadFromFileAlignWithOtherDataset(const char* ...
    function Dataset (line 364) | Dataset* DatasetLoader::LoadFromSerializedReference(const char* binary...
    function Dataset (line 425) | Dataset* DatasetLoader::LoadFromBinFile(const char* data_filename, con...
    function Dataset (line 601) | Dataset* DatasetLoader::ConstructFromSampleData(double** sample_values,

FILE: src/io/dense_bin.hpp
  type LightGBM (line 17) | namespace LightGBM {
    class DenseBin (line 20) | class DenseBin
      method DenseBin (line 57) | explicit DenseBin(data_size_t num_data)
      method Push (line 70) | void Push(int, data_size_t idx, uint32_t value) override {
      method ReSize (line 85) | void ReSize(data_size_t num_data) override {
      method ConstructHistogramInner (line 100) | void ConstructHistogramInner(const data_size_t* data_indices,
      method ConstructHistogram (line 144) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 152) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructHistogram (line 160) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 167) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructHistogramIntInner (line 176) | void ConstructHistogramIntInner(const data_size_t* data_indices,
      method ConstructHistogramInt8 (line 225) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 233) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method ConstructHistogramInt8 (line 241) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 248) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method ConstructHistogramInt16 (line 255) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 263) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramInt16 (line 271) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 278) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramInt32 (line 285) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 293) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method ConstructHistogramInt32 (line 301) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 308) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method data_size_t (line 317) | data_size_t SplitInner(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 397) | data_size_t Split(uint32_t min_bin, uint32_t max_bin, uint32_t defau...
      method data_size_t (line 424) | data_size_t Split(uint32_t max_bin, uint32_t default_bin,
      method data_size_t (line 452) | data_size_t SplitCategoricalInner(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 486) | data_size_t SplitCategorical(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 497) | data_size_t SplitCategorical(uint32_t max_bin, uint32_t most_freq_bin,
      method data_size_t (line 507) | data_size_t num_data() const override { return num_data_; }
      method FinishLoad (line 511) | void FinishLoad() override {
      method LoadFromMemory (line 524) | void LoadFromMemory(
      method VAL_T (line 560) | inline VAL_T data(data_size_t idx) const {
      method CopySubrow (line 568) | void CopySubrow(const Bin* full_bin, const data_size_t* used_indices,
      method SaveBinaryToFile (line 595) | void SaveBinaryToFile(BinaryWriter* writer) const override {
      method SizesInByte (line 599) | size_t SizesInByte() const override {
      method DenseBin (line 618) | DenseBin(const DenseBin<VAL_T, IS_4BIT>& other)
    class DenseBinIterator (line 23) | class DenseBinIterator : public BinIterator {
      method DenseBinIterator (line 25) | explicit DenseBinIterator(const DenseBin<VAL_T, IS_4BIT>* bin_data,
      method Reset (line 40) | inline void Reset(data_size_t) override {}
    class DenseBin (line 54) | class DenseBin : public Bin {
      method DenseBin (line 57) | explicit DenseBin(data_size_t num_data)
      method Push (line 70) | void Push(int, data_size_t idx, uint32_t value) override {
      method ReSize (line 85) | void ReSize(data_size_t num_data) override {
      method ConstructHistogramInner (line 100) | void ConstructHistogramInner(const data_size_t* data_indices,
      method ConstructHistogram (line 144) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 152) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructHistogram (line 160) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 167) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructHistogramIntInner (line 176) | void ConstructHistogramIntInner(const data_size_t* data_indices,
      method ConstructHistogramInt8 (line 225) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 233) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method ConstructHistogramInt8 (line 241) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 248) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method ConstructHistogramInt16 (line 255) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 263) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramInt16 (line 271) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 278) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramInt32 (line 285) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 293) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method ConstructHistogramInt32 (line 301) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 308) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method data_size_t (line 317) | data_size_t SplitInner(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 397) | data_size_t Split(uint32_t min_bin, uint32_t max_bin, uint32_t defau...
      method data_size_t (line 424) | data_size_t Split(uint32_t max_bin, uint32_t default_bin,
      method data_size_t (line 452) | data_size_t SplitCategoricalInner(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 486) | data_size_t SplitCategorical(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 497) | data_size_t SplitCategorical(uint32_t max_bin, uint32_t most_freq_bin,
      method data_size_t (line 507) | data_size_t num_data() const override { return num_data_; }
      method FinishLoad (line 511) | void FinishLoad() override {
      method LoadFromMemory (line 524) | void LoadFromMemory(
      method VAL_T (line 560) | inline VAL_T data(data_size_t idx) const {
      method CopySubrow (line 568) | void CopySubrow(const Bin* full_bin, const data_size_t* used_indices,
      method SaveBinaryToFile (line 595) | void SaveBinaryToFile(BinaryWriter* writer) const override {
      method SizesInByte (line 599) | size_t SizesInByte() const override {
      method DenseBin (line 618) | DenseBin(const DenseBin<VAL_T, IS_4BIT>& other)
    function BinIterator (line 643) | BinIterator* DenseBin<VAL_T, IS_4BIT>::GetIterator(

FILE: src/io/file_io.cpp
  type LightGBM (line 18) | namespace LightGBM {
    type LocalFile (line 20) | struct LocalFile : VirtualFileReader, VirtualFileWriter {
      method LocalFile (line 21) | LocalFile(const std::string& filename, const std::string& mode)
      method Init (line 29) | bool Init() {
      method Exists (line 40) | bool Exists() const {
      method Read (line 45) | size_t Read(void* buffer, size_t bytes) const {
      method Write (line 49) | size_t Write(const void* buffer, size_t bytes) {

FILE: src/io/json11.cpp
  type json11_internal_lightgbm (line 35) | namespace json11_internal_lightgbm {
    type NullStruct (line 51) | struct NullStruct {
    function dump (line 60) | static void dump(NullStruct, string *out) { *out += "null"; }
    function dump (line 62) | static void dump(double value, string *out) {
    function dump (line 72) | static void dump(int value, string *out) {
    function dump (line 78) | static void dump(bool value, string *out) { *out += value ? "true" : "...
    function dump (line 80) | static void dump(const string &value, string *out) {
    function dump (line 119) | static void dump(const Json::array &values, string *out) {
    function dump (line 130) | static void dump(const Json::object &values, string *out) {
    class Value (line 150) | class Value : public JsonValue {
      method Value (line 153) | explicit Value(const T &value) : m_value(value) {}
      method Value (line 154) | explicit Value(T &&value) : m_value(std::move(value)) {}
      method type (line 157) | Json::Type type() const override { return tag; }
      method equals (line 160) | bool equals(const JsonValue *other) const override {
      method less (line 163) | bool less(const JsonValue *other) const override {
      method dump (line 168) | void dump(string *out) const override { json11_internal_lightgbm::du...
    class JsonDouble (line 171) | class JsonDouble final : public Value<Json::NUMBER, double> {
      method number_value (line 172) | double number_value() const override { return m_value; }
      method int_value (line 173) | int int_value() const override { return static_cast<int>(m_value); }
      method equals (line 174) | bool equals(const JsonValue *other) const override {
      method less (line 177) | bool less(const JsonValue *other) const override {
      method JsonDouble (line 182) | explicit JsonDouble(double value) : Value(value) {}
    class JsonInt (line 185) | class JsonInt final : public Value<Json::NUMBER, int> {
      method number_value (line 186) | double number_value() const override { return m_value; }
      method int_value (line 187) | int int_value() const override { return m_value; }
      method equals (line 188) | bool equals(const JsonValue *other) const override {
      method less (line 191) | bool less(const JsonValue *other) const override {
      method JsonInt (line 196) | explicit JsonInt(int value) : Value(value) {}
    class JsonBoolean (line 199) | class JsonBoolean final : public Value<Json::BOOL, bool> {
      method bool_value (line 200) | bool bool_value() const override { return m_value; }
      method JsonBoolean (line 203) | explicit JsonBoolean(bool value) : Value(value) {}
    class JsonString (line 206) | class JsonString final : public Value<Json::STRING, string> {
      method string (line 207) | const string &string_value() const override { return m_value; }
      method JsonString (line 210) | explicit JsonString(const string &value) : Value(value) {}
      method JsonString (line 211) | explicit JsonString(string &&value) : Value(std::move(value)) {}
    class JsonArray (line 214) | class JsonArray final : public Value<Json::ARRAY, Json::array> {
      method JsonArray (line 219) | explicit JsonArray(const Json::array &value) : Value(value) {}
      method JsonArray (line 220) | explicit JsonArray(Json::array &&value) : Value(std::move(value)) {}
    class JsonObject (line 223) | class JsonObject final : public Value<Json::OBJECT, Json::object> {
      method JsonObject (line 228) | explicit JsonObject(const Json::object &value) : Value(value) {}
      method JsonObject (line 229) | explicit JsonObject(Json::object &&value) : Value(std::move(value)) {}
    class JsonNull (line 232) | class JsonNull final : public Value<Json::NUL, NullStruct> {
      method JsonNull (line 234) | JsonNull() : Value({}) {}
    type Statics (line 240) | struct Statics {
      method Statics (line 247) | Statics() {}
    function Statics (line 250) | static const Statics &statics() {
      method Statics (line 247) | Statics() {}
    function Json (line 255) | static const Json &static_null() {
    function string (line 290) | const string &Json::string_value() const { return m_ptr->string_value(...
    function Json (line 295) | const Json &Json::operator[](size_t i) const { return (*m_ptr)[i]; }
    function Json (line 296) | const Json &Json::operator[](const string &key) const { return (*m_ptr...
    function string (line 301) | const string &JsonValue::string_value() const { return statics().empty...
    function Json (line 308) | const Json &JsonValue::operator[](size_t) const { return static_null(); }
    function Json (line 309) | const Json &JsonValue::operator[](const string &) const {
    function Json (line 313) | const Json &JsonObject::operator[](const string &key) const {
    function Json (line 317) | const Json &JsonArray::operator[](size_t i) const {
    function string (line 351) | static inline string esc(char c) {
    function in_range (line 362) | static inline bool in_range(T x, T lower, T upper) {
    type JsonParser (line 371) | struct JsonParser final {
      method Json (line 385) | Json fail(string &&msg) { return fail(std::move(msg), Json()); }
      method T (line 388) | T fail(string &&msg, const T err_ret) {
      method consume_whitespace (line 398) | void consume_whitespace() {
      method consume_comment (line 407) | bool consume_comment() {
      method consume_garbage (line 445) | void consume_garbage() {
      method get_next_token (line 462) | char get_next_token() {
      method encode_utf8 (line 474) | void encode_utf8(int64_t pt, string* out) {
      method string (line 498) | string parse_string() {
      method Json (line 593) | Json parse_number() {
      method Json (line 645) | Json expect(const string &expected, Json res) {
      method Json (line 661) | Json parse_json(int depth) {
    function Json (line 733) | Json Json::parse(const string &in, string *err, JsonParse strategy) {

FILE: src/io/metadata.cpp
  type LightGBM (line 14) | namespace LightGBM {

FILE: src/io/multi_val_dense_bin.hpp
  type LightGBM (line 18) | namespace LightGBM {
    class MultiValDenseBin (line 21) | class MultiValDenseBin : public MultiValBin {
      method MultiValDenseBin (line 23) | explicit MultiValDenseBin(data_size_t num_data, int num_bin, int num...
      method data_size_t (line 33) | data_size_t num_data() const override {
      method num_bin (line 37) | int num_bin() const override {
      method num_element_per_row (line 41) | double num_element_per_row() const override { return num_feature_; }
      method PushOneRow (line 45) | void PushOneRow(int , data_size_t idx, const std::vector<uint32_t>& ...
      method FinishLoad (line 52) | void FinishLoad() override {
      method IsSparse (line 55) | bool IsSparse() override {
      method ConstructHistogramInner (line 60) | void ConstructHistogramInner(const data_size_t* data_indices, data_s...
      method ConstructHistogram (line 105) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 112) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructHistogramOrdered (line 119) | void ConstructHistogramOrdered(const data_size_t* data_indices,
      method ConstructHistogramIntInner (line 129) | void ConstructHistogramIntInner(const data_size_t* data_indices, dat...
      method ConstructHistogramInt32 (line 176) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 183) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method ConstructHistogramOrderedInt32 (line 190) | void ConstructHistogramOrderedInt32(const data_size_t* data_indices,
      method ConstructHistogramInt16 (line 199) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 206) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramOrderedInt16 (line 213) | void ConstructHistogramOrderedInt16(const data_size_t* data_indices,
      method ConstructHistogramInt8 (line 222) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 229) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method ConstructHistogramOrderedInt8 (line 236) | void ConstructHistogramOrderedInt8(const data_size_t* data_indices,
      method MultiValBin (line 245) | MultiValBin* CreateLike(data_size_t num_data, int num_bin, int num_f...
      method ReSize (line 250) | void ReSize(data_size_t num_data, int num_bin, int num_feature,
      method CopyInner (line 263) | void CopyInner(const MultiValBin* full_bin, const data_size_t* used_...
      method CopySubrow (line 301) | void CopySubrow(const MultiValBin* full_bin, const data_size_t* used...
      method CopySubcol (line 307) | void CopySubcol(const MultiValBin* full_bin,
      method CopySubrowAndSubcol (line 315) | void CopySubrowAndSubcol(const MultiValBin* full_bin,
      method RowPtr (line 326) | inline size_t RowPtr(data_size_t idx) const {
      method MultiValDenseBin (line 347) | MultiValDenseBin(const MultiValDenseBin<VAL_T>& other)

FILE: src/io/multi_val_sparse_bin.hpp
  type LightGBM (line 18) | namespace LightGBM {
    class MultiValSparseBin (line 21) | class MultiValSparseBin : public MultiValBin {
      method MultiValSparseBin (line 23) | explicit MultiValSparseBin(data_size_t num_data, int num_bin,
      method data_size_t (line 43) | data_size_t num_data() const override { return num_data_; }
      method num_bin (line 45) | int num_bin() const override { return num_bin_; }
      method num_element_per_row (line 47) | double num_element_per_row() const override {
      method PushOneRow (line 53) | void PushOneRow(int tid, data_size_t idx,
      method MergeData (line 77) | void MergeData(const INDEX_T* sizes) {
      method FinishLoad (line 99) | void FinishLoad() override {
      method IsSparse (line 111) | bool IsSparse() override { return true; }
      method ConstructHistogramInner (line 114) | void ConstructHistogramInner(const data_size_t* data_indices,
      method ConstructHistogram (line 161) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 168) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructHistogramOrdered (line 175) | void ConstructHistogramOrdered(const data_size_t* data_indices,
      method ConstructHistogramIntInner (line 185) | void ConstructHistogramIntInner(const data_size_t* data_indices,
      method ConstructHistogramInt32 (line 233) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 240) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method ConstructHistogramOrderedInt32 (line 247) | void ConstructHistogramOrderedInt32(const data_size_t* data_indices,
      method ConstructHistogramInt16 (line 256) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 263) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramOrderedInt16 (line 270) | void ConstructHistogramOrderedInt16(const data_size_t* data_indices,
      method ConstructHistogramInt8 (line 279) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 286) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method ConstructHistogramOrderedInt8 (line 293) | void ConstructHistogramOrderedInt8(const data_size_t* data_indices,
      method MultiValBin (line 302) | MultiValBin* CreateLike(data_size_t num_data, int num_bin, int,
      method ReSize (line 309) | void ReSize(data_size_t num_data, int num_bin, int,
      method CopyInner (line 332) | void CopyInner(const MultiValBin* full_bin, const data_size_t* used_...
      method CopySubrow (line 384) | void CopySubrow(const MultiValBin* full_bin, const data_size_t* used...
      method CopySubcol (line 391) | void CopySubcol(const MultiValBin* full_bin, const std::vector<int>&,
      method CopySubrowAndSubcol (line 398) | void CopySubrowAndSubcol(const MultiValBin* full_bin,
      method INDEX_T (line 409) | inline INDEX_T RowPtr(data_size_t idx) const { return row_ptr_[idx]; }
      method MultiValSparseBin (line 434) | MultiValSparseBin(const MultiValSparseBin<INDEX_T, VAL_T>& other)

FILE: src/io/parser.cpp
  type LightGBM (line 15) | namespace LightGBM {
    function GetStatistic (line 17) | void GetStatistic(const char* str, int* comma_cnt, int* tab_cnt, int* ...
    function GetLabelIdxForLibsvm (line 32) | int GetLabelIdxForLibsvm(const std::string& str, int num_features, int...
    function GetLabelIdxForTSV (line 46) | int GetLabelIdxForTSV(const std::string& str, int num_features, int la...
    function GetLabelIdxForCSV (line 59) | int GetLabelIdxForCSV(const std::string& str, int num_features, int la...
    type DataType (line 72) | enum DataType {
    function GetLine (line 79) | void GetLine(std::stringstream* ss, std::string* line, const VirtualFi...
    function ReadKLineFromFile (line 94) | std::vector<std::string> ReadKLineFromFile(const char* filename, bool ...
    function GetNumColFromLIBSVMFile (line 133) | int GetNumColFromLIBSVMFile(const char* filename, bool header) {
    function DataType (line 181) | DataType GetDataType(const char* filename, bool header,
    function ParserFactory (line 238) | ParserFactory& ParserFactory::getInstance() {
    function Parser (line 250) | Parser* ParserFactory::getObject(std::string class_name, std::string c...
    function Parser (line 261) | Parser* Parser::CreateParser(const char* filename, bool header, int nu...
    function Parser (line 289) | Parser* Parser::CreateParser(const char* filename, bool header, int nu...

FILE: src/io/parser.hpp
  type LightGBM (line 17) | namespace LightGBM {
    class CSVParser (line 19) | class CSVParser: public Parser {
      method CSVParser (line 21) | explicit CSVParser(int label_idx, int total_columns, AtofFunc atof)
      method ParseOneLine (line 24) | inline void ParseOneLine(const char* str,
      method NumFeatures (line 47) | inline int NumFeatures() const override {
    class TSVParser (line 57) | class TSVParser: public Parser {
      method TSVParser (line 59) | explicit TSVParser(int label_idx, int total_columns, AtofFunc atof)
      method ParseOneLine (line 62) | inline void ParseOneLine(const char* str,
      method NumFeatures (line 84) | inline int NumFeatures() const override {
    class LibSVMParser (line 94) | class LibSVMParser: public Parser {
      method LibSVMParser (line 96) | explicit LibSVMParser(int label_idx, int total_columns, AtofFunc atof)
      method ParseOneLine (line 102) | inline void ParseOneLine(const char* str,
      method NumFeatures (line 125) | inline int NumFeatures() const override {

FILE: src/io/sparse_bin.hpp
  type LightGBM (line 21) | namespace LightGBM {
    class SparseBin (line 24) | class SparseBin
      method SparseBin (line 78) | explicit SparseBin(data_size_t num_data) : num_data_(num_data) {
      method InitStreaming (line 85) | void InitStreaming(uint32_t num_thread, int32_t omp_max_threads) ove...
      method ReSize (line 91) | void ReSize(data_size_t num_data) override { num_data_ = num_data; }
      method Push (line 93) | void Push(int tid, data_size_t idx, uint32_t value) override {
      method ConstructHistogram (line 108) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 139) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructHistogram (line 155) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 188) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructIntHistogramInner (line 208) | void ConstructIntHistogramInner(data_size_t start, data_size_t end,
      method ConstructIntHistogramInner (line 243) | void ConstructIntHistogramInner(const data_size_t* data_indices, dat...
      method ConstructHistogramInt32 (line 307) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 314) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method ConstructHistogramInt32 (line 321) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 327) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method ConstructHistogramInt16 (line 333) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 340) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramInt16 (line 347) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 353) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramInt8 (line 359) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 366) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method ConstructHistogramInt8 (line 373) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 379) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method NextNonzeroFast (line 385) | inline void NextNonzeroFast(data_size_t* i_delta,
      method NextNonzero (line 393) | inline bool NextNonzero(data_size_t* i_delta, data_size_t* cur_pos) ...
      method data_size_t (line 405) | data_size_t SplitInner(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 486) | data_size_t Split(uint32_t min_bin, uint32_t max_bin, uint32_t defau...
      method data_size_t (line 513) | data_size_t Split(uint32_t max_bin, uint32_t default_bin,
      method data_size_t (line 540) | data_size_t SplitCategoricalInner(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 574) | data_size_t SplitCategorical(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 585) | data_size_t SplitCategorical(uint32_t max_bin, uint32_t most_freq_bin,
      method data_size_t (line 595) | data_size_t num_data() const override { return num_data_; }
      method FinishLoad (line 599) | void FinishLoad() override {
      method LoadFromPair (line 625) | void LoadFromPair(
      method GetFastIndex (line 662) | void GetFastIndex() {
      method SaveBinaryToFile (line 690) | void SaveBinaryToFile(BinaryWriter* writer) const override {
      method SizesInByte (line 696) | size_t SizesInByte() const override {
      method LoadFromMemory (line 702) | void LoadFromMemory(
      method CopySubrow (line 746) | void CopySubrow(const Bin* full_bin, const data_size_t* used_indices,
      method SparseBin (line 786) | SparseBin(const SparseBin<VAL_T>& other)
      method InitIndex (line 795) | void InitIndex(data_size_t start_idx, data_size_t* i_delta,
    class SparseBinIterator (line 29) | class SparseBinIterator : public BinIterator {
      method SparseBinIterator (line 31) | SparseBinIterator(const SparseBin<VAL_T>* bin_data, uint32_t min_bin,
      method SparseBinIterator (line 44) | SparseBinIterator(const SparseBin<VAL_T>* bin_data, data_size_t star...
      method Get (line 52) | inline uint32_t Get(data_size_t idx) override {
    class SparseBin (line 74) | class SparseBin : public Bin {
      method SparseBin (line 78) | explicit SparseBin(data_size_t num_data) : num_data_(num_data) {
      method InitStreaming (line 85) | void InitStreaming(uint32_t num_thread, int32_t omp_max_threads) ove...
      method ReSize (line 91) | void ReSize(data_size_t num_data) override { num_data_ = num_data; }
      method Push (line 93) | void Push(int tid, data_size_t idx, uint32_t value) override {
      method ConstructHistogram (line 108) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 139) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructHistogram (line 155) | void ConstructHistogram(const data_size_t* data_indices, data_size_t...
      method ConstructHistogram (line 188) | void ConstructHistogram(data_size_t start, data_size_t end,
      method ConstructIntHistogramInner (line 208) | void ConstructIntHistogramInner(data_size_t start, data_size_t end,
      method ConstructIntHistogramInner (line 243) | void ConstructIntHistogramInner(const data_size_t* data_indices, dat...
      method ConstructHistogramInt32 (line 307) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 314) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method ConstructHistogramInt32 (line 321) | void ConstructHistogramInt32(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt32 (line 327) | void ConstructHistogramInt32(data_size_t start, data_size_t end,
      method ConstructHistogramInt16 (line 333) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 340) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramInt16 (line 347) | void ConstructHistogramInt16(const data_size_t* data_indices, data_s...
      method ConstructHistogramInt16 (line 353) | void ConstructHistogramInt16(data_size_t start, data_size_t end,
      method ConstructHistogramInt8 (line 359) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 366) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method ConstructHistogramInt8 (line 373) | void ConstructHistogramInt8(const data_size_t* data_indices, data_si...
      method ConstructHistogramInt8 (line 379) | void ConstructHistogramInt8(data_size_t start, data_size_t end,
      method NextNonzeroFast (line 385) | inline void NextNonzeroFast(data_size_t* i_delta,
      method NextNonzero (line 393) | inline bool NextNonzero(data_size_t* i_delta, data_size_t* cur_pos) ...
      method data_size_t (line 405) | data_size_t SplitInner(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 486) | data_size_t Split(uint32_t min_bin, uint32_t max_bin, uint32_t defau...
      method data_size_t (line 513) | data_size_t Split(uint32_t max_bin, uint32_t default_bin,
      method data_size_t (line 540) | data_size_t SplitCategoricalInner(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 574) | data_size_t SplitCategorical(uint32_t min_bin, uint32_t max_bin,
      method data_size_t (line 585) | data_size_t SplitCategorical(uint32_t max_bin, uint32_t most_freq_bin,
      method data_size_t (line 595) | data_size_t num_data() const override { return num_data_; }
      method FinishLoad (line 599) | void FinishLoad() override {
      method LoadFromPair (line 625) | void LoadFromPair(
      method GetFastIndex (line 662) | void GetFastIndex() {
      method SaveBinaryToFile (line 690) | void SaveBinaryToFile(BinaryWriter* writer) const override {
      method SizesInByte (line 696) | size_t SizesInByte() const override {
      method LoadFromMemory (line 702) | void LoadFromMemory(
      method CopySubrow (line 746) | void CopySubrow(const Bin* full_bin, const data_size_t* used_indices,
      method SparseBin (line 786) | SparseBin(const SparseBin<VAL_T>& other)
      method InitIndex (line 795) | void InitIndex(data_size_t start_idx, data_size_t* i_delta,
    function VAL_T (line 834) | inline VAL_T SparseBinIterator<VAL_T>::InnerRawGet(data_size_t idx) {
    function BinIterator (line 851) | BinIterator* SparseBin<VAL_T>::GetIterator(uint32_t min_bin, uint32_t ...

FILE: src/io/train_share_states.cpp
  type LightGBM (line 14) | namespace LightGBM {

FILE: src/io/tree.cpp
  type LightGBM (line 20) | namespace LightGBM {

FILE: src/main.cpp
  function main (line 15) | int main(int argc, char** argv) {

FILE: src/metric/binary_metric.hpp
  type LightGBM (line 18) | namespace LightGBM {
    class BinaryMetric (line 25) | class BinaryMetric: public Metric {
      method BinaryMetric (line 27) | explicit BinaryMetric(const Config&) {
      method Init (line 33) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method factor_to_bigger_better (line 57) | double factor_to_bigger_better() const override {
      method Eval (line 61) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...
    class BinaryLoglossMetric (line 116) | class BinaryLoglossMetric: public BinaryMetric<BinaryLoglossMetric> {
      method BinaryLoglossMetric (line 118) | explicit BinaryLoglossMetric(const Config& config) :BinaryMetric<Bin...
      method LossOnPoint (line 120) | inline static double LossOnPoint(label_t label, double prob) {
    class BinaryErrorMetric (line 140) | class BinaryErrorMetric: public BinaryMetric<BinaryErrorMetric> {
      method BinaryErrorMetric (line 142) | explicit BinaryErrorMetric(const Config& config) :BinaryMetric<Binar...
      method LossOnPoint (line 144) | inline static double LossOnPoint(label_t label, double prob) {
    class AUCMetric (line 160) | class AUCMetric: public Metric {
      method AUCMetric (line 162) | explicit AUCMetric(const Config&) {
      method factor_to_bigger_better (line 172) | double factor_to_bigger_better() const override {
      method Init (line 176) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method Eval (line 195) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...
    class AveragePrecisionMetric (line 271) | class AveragePrecisionMetric: public Metric {
      method AveragePrecisionMetric (line 273) | explicit AveragePrecisionMetric(const Config&) {
      method factor_to_bigger_better (line 283) | double factor_to_bigger_better() const override {
      method Init (line 287) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method Eval (line 306) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...

FILE: src/metric/cuda/cuda_binary_metric.cpp
  type LightGBM (line 14) | namespace LightGBM {

FILE: src/metric/cuda/cuda_binary_metric.hpp
  type LightGBM (line 21) | namespace LightGBM {
    class CUDABinaryMetricInterface (line 24) | class CUDABinaryMetricInterface: public CUDAPointwiseMetricInterface<H...
      method CUDABinaryMetricInterface (line 26) | explicit CUDABinaryMetricInterface(const Config& config): CUDAPointw...
    class CUDABinaryLoglossMetric (line 33) | class CUDABinaryLoglossMetric: public CUDABinaryMetricInterface<Binary...
      method __device__ (line 39) | __device__ static double MetricOnPointCUDA(label_t label, double sco...
    class CUDABinaryErrorMetric (line 54) | class CUDABinaryErrorMetric: public CUDABinaryMetricInterface<BinaryEr...
      method __device__ (line 60) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...

FILE: src/metric/cuda/cuda_pointwise_metric.cpp
  type LightGBM (line 14) | namespace LightGBM {

FILE: src/metric/cuda/cuda_pointwise_metric.hpp
  type LightGBM (line 20) | namespace LightGBM {
    class CUDAPointwiseMetricInterface (line 23) | class CUDAPointwiseMetricInterface: public CUDAMetricInterface<HOST_ME...
      method CUDAPointwiseMetricInterface (line 25) | explicit CUDAPointwiseMetricInterface(const Config& config): CUDAMet...
      method GetParamFromConfig (line 34) | virtual double GetParamFromConfig() const { return 0.0; }

FILE: src/metric/cuda/cuda_regression_metric.cpp
  type LightGBM (line 14) | namespace LightGBM {

FILE: src/metric/cuda/cuda_regression_metric.hpp
  type LightGBM (line 21) | namespace LightGBM {
    class CUDARegressionMetricInterface (line 24) | class CUDARegressionMetricInterface: public CUDAPointwiseMetricInterfa...
      method CUDARegressionMetricInterface (line 26) | explicit CUDARegressionMetricInterface(const Config& config):
    class CUDARMSEMetric (line 34) | class CUDARMSEMetric: public CUDARegressionMetricInterface<RMSEMetric,...
      method __device__ (line 40) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
    class CUDAL2Metric (line 45) | class CUDAL2Metric : public CUDARegressionMetricInterface<L2Metric, CU...
      method __device__ (line 51) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
    class CUDAQuantileMetric (line 56) | class CUDAQuantileMetric : public CUDARegressionMetricInterface<Quanti...
      method __device__ (line 62) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
      method GetParamFromConfig (line 71) | double GetParamFromConfig() const override {
    class CUDAL1Metric (line 79) | class CUDAL1Metric : public CUDARegressionMetricInterface<L1Metric, CU...
      method __device__ (line 85) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
    class CUDAHuberLossMetric (line 90) | class CUDAHuberLossMetric : public CUDARegressionMetricInterface<Huber...
      method __device__ (line 96) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
      method GetParamFromConfig (line 105) | double GetParamFromConfig() const override {
    class CUDAFairLossMetric (line 112) | class CUDAFairLossMetric : public CUDARegressionMetricInterface<FairLo...
      method __device__ (line 118) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
      method GetParamFromConfig (line 124) | double GetParamFromConfig() const override {
    class CUDAPoissonMetric (line 132) | class CUDAPoissonMetric : public CUDARegressionMetricInterface<Poisson...
      method __device__ (line 138) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
    class CUDAMAPEMetric (line 147) | class CUDAMAPEMetric : public CUDARegressionMetricInterface<MAPEMetric...
      method __device__ (line 153) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
    class CUDAGammaMetric (line 158) | class CUDAGammaMetric : public CUDARegressionMetricInterface<GammaMetr...
      method __device__ (line 164) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
    class CUDAGammaDevianceMetric (line 174) | class CUDAGammaDevianceMetric : public CUDARegressionMetricInterface<G...
      method __device__ (line 180) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
    class CUDATweedieMetric (line 187) | class CUDATweedieMetric : public CUDARegressionMetricInterface<Tweedie...
      method __device__ (line 193) | __device__ inline static double MetricOnPointCUDA(label_t label, dou...
      method GetParamFromConfig (line 204) | double GetParamFromConfig() const override {

FILE: src/metric/dcg_calculator.cpp
  type LightGBM (line 13) | namespace LightGBM {

FILE: src/metric/map_metric.hpp
  type LightGBM (line 19) | namespace LightGBM {
    class MapMetric (line 21) | class MapMetric:public Metric {
      method MapMetric (line 23) | explicit MapMetric(const Config& config) {
      method Init (line 32) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method factor_to_bigger_better (line 71) | double factor_to_bigger_better() const override {
      method CalMapAtK (line 75) | void CalMapAtK(std::vector<int> ks, data_size_t npos, const label_t*...
      method Eval (line 108) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...

FILE: src/metric/metric.cpp
  type LightGBM (line 20) | namespace LightGBM {
    function Metric (line 22) | Metric* Metric::CreateMetric(const std::string& type, const Config& co...

FILE: src/metric/multiclass_metric.hpp
  type LightGBM (line 17) | namespace LightGBM {
    class MulticlassMetric (line 23) | class MulticlassMetric: public Metric {
      method MulticlassMetric (line 25) | explicit MulticlassMetric(const Config& config) :config_(config) {
      method Init (line 32) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method factor_to_bigger_better (line 53) | double factor_to_bigger_better() const override {
      method Eval (line 57) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...
    class MultiErrorMetric (line 139) | class MultiErrorMetric: public MulticlassMetric<MultiErrorMetric> {
      method MultiErrorMetric (line 141) | explicit MultiErrorMetric(const Config& config) :MulticlassMetric<Mu...
      method LossOnPoint (line 143) | inline static double LossOnPoint(label_t label, std::vector<double>*...
      method Name (line 154) | inline static const std::string Name(const Config& config) {
    class MultiSoftmaxLoglossMetric (line 164) | class MultiSoftmaxLoglossMetric: public MulticlassMetric<MultiSoftmaxL...
      method MultiSoftmaxLoglossMetric (line 166) | explicit MultiSoftmaxLoglossMetric(const Config& config) :Multiclass...
      method LossOnPoint (line 168) | inline static double LossOnPoint(label_t label, std::vector<double>*...
      method Name (line 178) | inline static const std::string Name(const Config&) {
    class AucMuMetric (line 184) | class AucMuMetric : public Metric {
      method AucMuMetric (line 186) | explicit AucMuMetric(const Config& config) : config_(config) {
      method factor_to_bigger_better (line 195) | double factor_to_bigger_better() const override { return 1.0f; }
      method Init (line 197) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method Eval (line 239) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...

FILE: src/metric/rank_metric.hpp
  type LightGBM (line 18) | namespace LightGBM {
    class NDCGMetric (line 20) | class NDCGMetric:public Metric {
      method NDCGMetric (line 22) | explicit NDCGMetric(const Config& config) {
      method Init (line 34) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method factor_to_bigger_better (line 83) | double factor_to_bigger_better() const override {
      method Eval (line 87) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...

FILE: src/metric/regression_metric.hpp
  type LightGBM (line 17) | namespace LightGBM {
    class RegressionMetric (line 23) | class RegressionMetric: public Metric {
      method RegressionMetric (line 25) | explicit RegressionMetric(const Config& config) :config_(config) {
      method factor_to_bigger_better (line 35) | double factor_to_bigger_better() const override {
      method Init (line 39) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method Eval (line 59) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...
      method AverageLoss (line 98) | inline static double AverageLoss(double sum_loss, double sum_weights) {
      method CheckLabel (line 102) | inline static void CheckLabel(label_t) {
    class RMSEMetric (line 120) | class RMSEMetric: public RegressionMetric<RMSEMetric> {
      method RMSEMetric (line 122) | explicit RMSEMetric(const Config& config) :RegressionMetric<RMSEMetr...
      method LossOnPoint (line 124) | inline static double LossOnPoint(label_t label, double score, const ...
      method AverageLoss (line 128) | inline static double AverageLoss(double sum_loss, double sum_weights) {
    class L2Metric (line 139) | class L2Metric: public RegressionMetric<L2Metric> {
      method L2Metric (line 141) | explicit L2Metric(const Config& config) :RegressionMetric<L2Metric>(...
      method LossOnPoint (line 143) | inline static double LossOnPoint(label_t label, double score, const ...
    class QuantileMetric (line 153) | class QuantileMetric : public RegressionMetric<QuantileMetric> {
      method QuantileMetric (line 155) | explicit QuantileMetric(const Config& config) :RegressionMetric<Quan...
      method LossOnPoint (line 158) | inline static double LossOnPoint(label_t label, double score, const ...
    class L1Metric (line 174) | class L1Metric: public RegressionMetric<L1Metric> {
      method L1Metric (line 176) | explicit L1Metric(const Config& config) :RegressionMetric<L1Metric>(...
      method LossOnPoint (line 178) | inline static double LossOnPoint(label_t label, double score, const ...
    class HuberLossMetric (line 187) | class HuberLossMetric: public RegressionMetric<HuberLossMetric> {
      method HuberLossMetric (line 189) | explicit HuberLossMetric(const Config& config) :RegressionMetric<Hub...
      method LossOnPoint (line 192) | inline static double LossOnPoint(label_t label, double score, const ...
    class FairLossMetric (line 208) | class FairLossMetric: public RegressionMetric<FairLossMetric> {
      method FairLossMetric (line 210) | explicit FairLossMetric(const Config& config) :RegressionMetric<Fair...
      method LossOnPoint (line 213) | inline static double LossOnPoint(label_t label, double score, const ...
    class PoissonMetric (line 225) | class PoissonMetric: public RegressionMetric<PoissonMetric> {
      method PoissonMetric (line 227) | explicit PoissonMetric(const Config& config) :RegressionMetric<Poiss...
      method LossOnPoint (line 230) | inline static double LossOnPoint(label_t label, double score, const ...
    class MAPEMetric (line 244) | class MAPEMetric : public RegressionMetric<MAPEMetric> {
      method MAPEMetric (line 246) | explicit MAPEMetric(const Config& config) :RegressionMetric<MAPEMetr...
      method LossOnPoint (line 249) | inline static double LossOnPoint(label_t label, double score, const ...
    class GammaMetric (line 257) | class GammaMetric : public RegressionMetric<GammaMetric> {
      method GammaMetric (line 259) | explicit GammaMetric(const Config& config) :RegressionMetric<GammaMe...
      method LossOnPoint (line 262) | inline static double LossOnPoint(label_t label, double score, const ...
      method CheckLabel (line 274) | inline static void CheckLabel(label_t label) {
    class GammaDevianceMetric (line 280) | class GammaDevianceMetric : public RegressionMetric<GammaDevianceMetri...
      method GammaDevianceMetric (line 282) | explicit GammaDevianceMetric(const Config& config) :RegressionMetric...
      method LossOnPoint (line 285) | inline static double LossOnPoint(label_t label, double score, const ...
      method AverageLoss (line 293) | inline static double AverageLoss(double sum_loss, double) {
      method CheckLabel (line 296) | inline static void CheckLabel(label_t label) {
    class TweedieMetric (line 301) | class TweedieMetric : public RegressionMetric<TweedieMetric> {
      method TweedieMetric (line 303) | explicit TweedieMetric(const Config& config) :RegressionMetric<Tweed...
      method LossOnPoint (line 306) | inline static double LossOnPoint(label_t label, double score, const ...
    class R2Metric (line 322) | class R2Metric: public Metric {
      method R2Metric (line 324) | explicit R2Metric(const Config& config) :config_(config) {}
      method factor_to_bigger_better (line 329) | double factor_to_bigger_better() const override {
      method Init (line 333) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method Eval (line 375) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...

FILE: src/metric/xentropy_metric.hpp
  type LightGBM (line 32) | namespace LightGBM {
    function XentLoss (line 36) | inline static double XentLoss(label_t label, double prob) {
    function XentLambdaLoss (line 54) | inline static double XentLambdaLoss(label_t label, label_t weight, dou...
    function YentLoss (line 61) | inline static double YentLoss(double p) {
    class CrossEntropyMetric (line 72) | class CrossEntropyMetric : public Metric {
      method CrossEntropyMetric (line 74) | explicit CrossEntropyMetric(const Config&) {}
      method Init (line 77) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method Eval (line 107) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...
      method factor_to_bigger_better (line 146) | double factor_to_bigger_better() const override {
    class CrossEntropyLambdaMetric (line 167) | class CrossEntropyLambdaMetric : public Metric {
      method CrossEntropyLambdaMetric (line 169) | explicit CrossEntropyLambdaMetric(const Config&) {}
      method Init (line 172) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method Eval (line 192) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...
      method factor_to_bigger_better (line 232) | double factor_to_bigger_better() const override {
    class KullbackLeiblerDivergence (line 250) | class KullbackLeiblerDivergence : public Metric {
      method KullbackLeiblerDivergence (line 252) | explicit KullbackLeiblerDivergence(const Config&) {}
      method Init (line 255) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method Eval (line 299) | std::vector<double> Eval(const double* score, const ObjectiveFunctio...
      method factor_to_bigger_better (line 338) | double factor_to_bigger_better() const override {

FILE: src/network/linker_topo.cpp
  type LightGBM (line 14) | namespace LightGBM {
    function BruckMap (line 30) | BruckMap BruckMap::Construct(int rank, int num_machines) {
    function RecursiveHalvingMap (line 69) | RecursiveHalvingMap RecursiveHalvingMap::Construct(int rank, int num_m...

FILE: src/network/linkers.h
  function namespace (line 31) | namespace LightGBM {

FILE: src/network/linkers_mpi.cpp
  type LightGBM (line 12) | namespace LightGBM {

FILE: src/network/linkers_socket.cpp
  type LightGBM (line 24) | namespace LightGBM {

FILE: src/network/network.cpp
  type LightGBM (line 18) | namespace LightGBM {

FILE: src/network/socket_wrapper.hpp
  type LightGBM (line 49) | namespace LightGBM {
    function inet_pton (line 62) | inline int inet_pton(int af, const char *src, void *dst) {
    type SocketConfig (line 90) | namespace SocketConfig {
    class TcpSocket (line 96) | class TcpSocket {
      method TcpSocket (line 98) | TcpSocket() {
      method TcpSocket (line 107) | explicit TcpSocket(SOCKET socket) {
      method TcpSocket (line 116) | TcpSocket(const TcpSocket &object) {
      method SetTimeout (line 122) | inline void SetTimeout(int timeout_ms) {
      method ConfigSocket (line 133) | inline void ConfigSocket() {
      method Startup (line 150) | inline static void Startup() {
      method Finalize (line 163) | inline static void Finalize() {
      method GetLastError (line 169) | inline static int GetLastError() {
      method GetLocalIpList (line 180) | inline static std::unordered_set<std::string> GetLocalIpList() {
      method GetLocalIpList (line 219) | inline static std::unordered_set<std::string> GetLocalIpList() {
      method sockaddr_in (line 243) | inline static sockaddr_in GetAddress(const char* url, int port) {
      method Bind (line 252) | inline bool Bind(int port) {
      method Connect (line 260) | inline bool Connect(const char *url, int port) {
      method Listen (line 268) | inline void Listen(int backlog = 128) {
      method TcpSocket (line 272) | inline TcpSocket Accept() {
      method Send (line 285) | inline int Send(const char *buf_, int len, int flag = 0) {
      method Recv (line 298) | inline int Recv(char *buf_, int len, int flags = 0) {
      method IsClosed (line 311) | inline bool IsClosed() {
      method Close (line 315) | inline void Close() {

FILE: src/objective/binary_objective.hpp
  type LightGBM (line 18) | namespace LightGBM {
    class BinaryLogloss (line 22) | class BinaryLogloss: public ObjectiveFunction {
      method BinaryLogloss (line 24) | explicit BinaryLogloss(const Config& config,
      method BinaryLogloss (line 42) | explicit BinaryLogloss(const std::vector<std::string>& strs)
      method Init (line 60) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method GetGradients (line 106) | void GetGradients(const double* score, score_t* gradients, score_t* ...
      method BoostFromScore (line 140) | double BoostFromScore(int) const override {
      method ClassNeedTrain (line 168) | bool ClassNeedTrain(int /*class_id*/) const override {
      method ConvertOutput (line 176) | void ConvertOutput(const double* input, double* output) const overri...
      method ToString (line 180) | std::string ToString() const override {
      method SkipEmptyClass (line 187) | bool SkipEmptyClass() const override { return true; }
      method NeedAccuratePrediction (line 189) | bool NeedAccuratePrediction() const override { return false; }
      method data_size_t (line 191) | data_size_t NumPositiveData() const override { return num_pos_data_; }

FILE: src/objective/cuda/cuda_binary_objective.cpp
  type LightGBM (line 15) | namespace LightGBM {

FILE: src/objective/cuda/cuda_binary_objective.hpp
  type LightGBM (line 23) | namespace LightGBM {
    class CUDABinaryLogloss (line 25) | class CUDABinaryLogloss : public CUDAObjectiveInterface<BinaryLogloss> {
      method NeedConvertOutputCUDA (line 37) | bool NeedConvertOutputCUDA() const override { return true; }

FILE: src/objective/cuda/cuda_multiclass_objective.cpp
  type LightGBM (line 14) | namespace LightGBM {

FILE: src/objective/cuda/cuda_rank_objective.hpp
  type LightGBM (line 24) | namespace LightGBM {
    class CUDALambdaRankObjectiveInterface (line 27) | class CUDALambdaRankObjectiveInterface : public CUDAObjectiveInterface...
      method CUDALambdaRankObjectiveInterface (line 29) | explicit CUDALambdaRankObjectiveInterface(const Config& config): CUD...
      method CUDALambdaRankObjectiveInterface (line 31) | explicit CUDALambdaRankObjectiveInterface(const std::vector<std::str...
      method Init (line 35) | void Init(const Metadata& metadata, data_size_t num_data) override {
    class CUDALambdarankNDCG (line 80) | class CUDALambdarankNDCG: public CUDALambdaRankObjectiveInterface<Lamb...
    class CUDARankXENDCG (line 99) | class CUDARankXENDCG : public CUDALambdaRankObjectiveInterface<RankXEN...

FILE: src/objective/cuda/cuda_regression_objective.cpp
  type LightGBM (line 15) | namespace LightGBM {

FILE: src/objective/cuda/cuda_regression_objective.hpp
  type LightGBM (line 22) | namespace LightGBM {
    class CUDARegressionObjectiveInterface (line 25) | class CUDARegressionObjectiveInterface: public CUDAObjectiveInterface<...
      method CUDARegressionObjectiveInterface (line 27) | explicit CUDARegressionObjectiveInterface(const Config& config): CUD...
      method CUDARegressionObjectiveInterface (line 29) | explicit CUDARegressionObjectiveInterface(const std::vector<std::str...
    class CUDARegressionL2loss (line 40) | class CUDARegressionL2loss : public CUDARegressionObjectiveInterface<R...
      method NeedConvertOutputCUDA (line 55) | bool NeedConvertOutputCUDA() const override { return sqrt_; }
    class CUDARegressionL1loss (line 59) | class CUDARegressionL1loss : public CUDARegressionObjectiveInterface<R...
    class CUDARegressionHuberLoss (line 87) | class CUDARegressionHuberLoss : public CUDARegressionObjectiveInterfac...
    class CUDARegressionFairLoss (line 101) | class CUDARegressionFairLoss : public CUDARegressionObjectiveInterface...
    class CUDARegressionPoissonLoss (line 114) | class CUDARegressionPoissonLoss : public CUDARegressionObjectiveInterf...
      method NeedConvertOutputCUDA (line 129) | bool NeedConvertOutputCUDA() const override { return true; }
    class CUDARegressionQuantileloss (line 137) | class CUDARegressionQuantileloss : public CUDARegressionObjectiveInter...

FILE: src/objective/multiclass_objective.hpp
  type LightGBM (line 21) | namespace LightGBM {
    class MulticlassSoftmax (line 25) | class MulticlassSoftmax: public ObjectiveFunction {
      method MulticlassSoftmax (line 27) | explicit MulticlassSoftmax(const Config& config) {
      method MulticlassSoftmax (line 35) | explicit MulticlassSoftmax(const std::vector<std::string>& strs) {
      method Init (line 54) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method GetGradients (line 87) | void GetGradients(const double* score, score_t* gradients, score_t* ...
      method ConvertOutput (line 133) | void ConvertOutput(const double* input, double* output) const overri...
      method ToString (line 141) | std::string ToString() const override {
      method SkipEmptyClass (line 148) | bool SkipEmptyClass() const override { return true; }
      method NumModelPerIteration (line 150) | int NumModelPerIteration() const override { return num_class_; }
      method NumPredictOneRow (line 152) | int NumPredictOneRow() const override { return num_class_; }
      method NeedAccuratePrediction (line 154) | bool NeedAccuratePrediction() const override { return false; }
      method BoostFromScore (line 156) | double BoostFromScore(int class_id) const override {
      method ClassNeedTrain (line 160) | bool ClassNeedTrain(int class_id) const override {
    class MulticlassOVA (line 187) | class MulticlassOVA: public ObjectiveFunction {
      method MulticlassOVA (line 189) | explicit MulticlassOVA(const Config& config) {
      method MulticlassOVA (line 198) | explicit MulticlassOVA(const std::vector<std::string>& strs) {
      method Init (line 222) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method GetGradients (line 229) | void GetGradients(const double* score, score_t* gradients, score_t* ...
      method ConvertOutput (line 240) | void ConvertOutput(const double* input, double* output) const overri...
      method ToString (line 246) | std::string ToString() const override {
      method SkipEmptyClass (line 254) | bool SkipEmptyClass() const override { return true; }
      method NumModelPerIteration (line 256) | int NumModelPerIteration() const override { return num_class_; }
      method NumPredictOneRow (line 258) | int NumPredictOneRow() const override { return num_class_; }
      method NeedAccuratePrediction (line 260) | bool NeedAccuratePrediction() const override { return false; }
      method BoostFromScore (line 262) | double BoostFromScore(int class_id) const override {
      method ClassNeedTrain (line 266) | bool ClassNeedTrain(int class_id) const override {

FILE: src/objective/objective_function.cpp
  type LightGBM (line 24) | namespace LightGBM {
    function ObjectiveFunction (line 27) | ObjectiveFunction* ObjectiveFunction::CreateObjectiveFunctionCUDA(cons...
    function ObjectiveFunction (line 72) | ObjectiveFunction* ObjectiveFunction::CreateObjectiveFunction(const st...

FILE: src/objective/rank_objective.hpp
  type LightGBM (line 21) | namespace LightGBM {
    class RankingObjective (line 26) | class RankingObjective : public ObjectiveFunction {
      method RankingObjective (line 28) | explicit RankingObjective(const Config& config)
      method RankingObjective (line 34) | explicit RankingObjective(const std::vector<std::string>&) : seed_(0...
      method Init (line 38) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method GetGradientsWithSampledQueries (line 60) | void GetGradientsWithSampledQueries(const double* score, const data_...
      method GetGradients (line 90) | void GetGradients(const double* score, score_t* gradients, score_t* ...
      method UpdatePositionBiasFactors (line 99) | virtual void UpdatePositionBiasFactors(const score_t* /*lambdas*/, c...
      method ToString (line 103) | std::string ToString() const override {
      method NeedAccuratePrediction (line 109) | bool NeedAccuratePrediction() const override { return false; }
    class LambdarankNDCG (line 139) | class LambdarankNDCG : public RankingObjective {
      method LambdarankNDCG (line 141) | explicit LambdarankNDCG(const Config& config)
      method LambdarankNDCG (line 157) | explicit LambdarankNDCG(const std::vector<std::string>& strs)
      method Init (line 162) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method GetGradientsForOneQuery (line 181) | inline void GetGradientsForOneQuery(data_size_t query_id, data_size_...
      method GetSigmoid (line 275) | inline double GetSigmoid(double score) const {
      method ConstructSigmoidTable (line 288) | void ConstructSigmoidTable() {
      method UpdatePositionBiasFactors (line 303) | void UpdatePositionBiasFactors(const score_t* lambdas, const score_t...
      method LogDebugPositionBiasFactors (line 345) | void LogDebugPositionBiasFactors() const {
    class RankXENDCG (line 385) | class RankXENDCG : public RankingObjective {
      method RankXENDCG (line 387) | explicit RankXENDCG(const Config& config) : RankingObjective(config) {}
      method RankXENDCG (line 389) | explicit RankXENDCG(const std::vector<std::string>& strs)
      method Init (line 394) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method GetGradientsForOneQuery (line 401) | inline void GetGradientsForOneQuery(data_size_t query_id, data_size_...
      method Phi (line 455) | double Phi(const label_t l, double g) const {

FILE: src/objective/xentropy_objective.hpp
  type LightGBM (line 41) | namespace LightGBM {
    class CrossEntropy (line 45) | class CrossEntropy: public ObjectiveFunction {
      method CrossEntropy (line 47) | explicit CrossEntropy(const Config& config)
      method CrossEntropy (line 50) | explicit CrossEntropy(const std::vector<std::string>&)
      method Init (line 56) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method GetGradients (line 78) | void GetGradients(const double* score, score_t* gradients, score_t* ...
      method ConvertOutput (line 136) | void ConvertOutput(const double* input, double* output) const overri...
      method ToString (line 140) | std::string ToString() const override {
      method BoostFromScore (line 147) | double BoostFromScore(int) const override {
    class CrossEntropyLambda (line 186) | class CrossEntropyLambda: public ObjectiveFunction {
      method CrossEntropyLambda (line 188) | explicit CrossEntropyLambda(const Config& config)
      method CrossEntropyLambda (line 193) | explicit CrossEntropyLambda(const std::vector<std::string>&)
      method Init (line 198) | void Init(const Metadata& metadata, data_size_t num_data) override {
      method GetGradients (line 224) | void GetGradients(const double* score, score_t* gradients, score_t* ...
      method ConvertOutput (line 267) | void ConvertOutput(const double* input, double* output) const overri...
      method ToString (line 271) | std::string ToString() const override {
      method BoostFromScore (line 277) | double BoostFromScore(int) const override {

FILE: src/treelearner/cost_effective_gradient_boosting.hpp
  type LightGBM (line 22) | namespace LightGBM {
    class CostEfficientGradientBoosting (line 24) | class CostEfficientGradientBoosting {
      method CostEfficientGradientBoosting (line 26) | explicit CostEfficientGradientBoosting(const SerialTreeLearner* tree...
      method IsEnable (line 28) | static bool IsEnable(const Config* config) {
      method Init (line 38) | void Init() {
      method BeforeTrain (line 70) | void BeforeTrain() {
      method DeltaGain (line 80) | double DeltaGain(int feature_index, int real_fidx, int leaf_index,
      method UpdateLeafBestSplits (line 100) | void UpdateLeafBestSplits(Tree* tree, int best_leaf,
      method CalculateOndemandCosts (line 140) | double CalculateOndemandCosts(int feature_index, int real_fidx,

FILE: src/treelearner/cuda/cuda_best_split_finder.cpp
  type LightGBM (line 15) | namespace LightGBM {
    function CUDASplitInfo (line 336) | const CUDASplitInfo* CUDABestSplitFinder::FindBestFromAllSplits(

FILE: src/treelearner/cuda/cuda_gradient_discretizer.hpp
  type LightGBM (line 25) | namespace LightGBM {
    class CUDAGradientDiscretizer (line 29) | class CUDAGradientDiscretizer: public GradientDiscretizer, public NCCL...
      method CUDAGradientDiscretizer (line 31) | CUDAGradientDiscretizer(int num_grad_quant_bins, int num_trees, int ...
      method grad_scale (line 44) | double grad_scale() const override {
      method hess_scale (line 49) | double hess_scale() const override {
      method score_t (line 54) | const score_t* grad_scale_ptr() const { return grad_max_block_buffer...
      method score_t (line 56) | const score_t* hess_scale_ptr() const { return hess_max_block_buffer...
      method Init (line 58) | void Init(const data_size_t num_data, const int num_leaves,
Copy disabled (too large) Download .json
Condensed preview — 509 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (16,827K chars).
[
  {
    "path": ".appveyor.yml",
    "chars": 1290,
    "preview": "version: 4.6.0.99.{build}\n\nimage: Visual Studio 2017\nplatform: x64\nconfiguration:\n  - '3.9'\n\n# only build on 'master' an"
  },
  {
    "path": ".ci/README.md",
    "chars": 321,
    "preview": "Helper Scripts for CI\r\n=====================\r\n\r\nThis folder contains scripts which are run on CI services.\r\n\r\nDockerfil"
  },
  {
    "path": ".ci/append-comment.sh",
    "chars": 897,
    "preview": "#!/bin/bash\n#\n# [description]\n#     Post a comment to a pull request.\n#\n# [usage]\n#     append-comment.sh <PULL_REQUEST_"
  },
  {
    "path": ".ci/build-docs.sh",
    "chars": 201,
    "preview": "#!/bin/bash\n\nset -e -E -u -o pipefail\n\nconda env create \\\n    --name test-env \\\n    --file ./docs/env.yml \\\n|| exit 1\n\n#"
  },
  {
    "path": ".ci/check-dynamic-dependencies.sh",
    "chars": 3574,
    "preview": "#!/bin/bash\n#\n# [description]\n#     Helper script for checking versions in the dynamic symbol table.\n#     This script c"
  },
  {
    "path": ".ci/check-omp-pragmas.sh",
    "chars": 1025,
    "preview": "#!/bin/bash\n\nset -e -u\n\necho \"checking that all OpenMP pragmas specify num_threads()\"\nget_omp_pragmas_without_num_thread"
  },
  {
    "path": ".ci/check-python-dists.sh",
    "chars": 1742,
    "preview": "#!/bin/sh\n\nset -e -u\n\nDIST_DIR=${1}\n\n# defaults\nMETHOD=${METHOD:-\"\"}\nTASK=${TASK:-\"\"}\n\necho \"checking Python-package dis"
  },
  {
    "path": ".ci/check-workflow-status.sh",
    "chars": 1554,
    "preview": "#!/bin/bash\n\n# [description]\n#\n#   Look for the last run of a given GitHub Actions workflow on a given branch.\n#   If th"
  },
  {
    "path": ".ci/conda-envs/README.md",
    "chars": 456,
    "preview": "# conda-envs\n\nThis directory contains files used to create `conda` environments for development\nand testing of LightGBM."
  },
  {
    "path": ".ci/conda-envs/ci-core-py39.txt",
    "chars": 1110,
    "preview": "# [description]\n#\n#   Similar to ci-core.txt, but specific to Python 3.9.\n#\n#   Unlike ci-core.txt, this includes a Pyth"
  },
  {
    "path": ".ci/conda-envs/ci-core.txt",
    "chars": 912,
    "preview": "# [description]\n#\n#   Core dependencies used across most LightGBM continuous integration (CI) jobs.\n#\n#   'python' const"
  },
  {
    "path": ".ci/create-nuget.py",
    "chars": 4399,
    "preview": "# coding: utf-8\n\"\"\"Script for generating files with NuGet package metadata.\"\"\"\n\nimport datetime\nimport sys\nfrom pathlib "
  },
  {
    "path": ".ci/download-artifacts.sh",
    "chars": 2183,
    "preview": "#!/bin/bash\n\n# [description]\n#     Collect and download artifacts from all workflow runs for a commit.\n#\n# [usage]\n#    "
  },
  {
    "path": ".ci/install-opencl.ps1",
    "chars": 1368,
    "preview": "Write-Output \"Installing OpenCL CPU platform\"\n\n$installer = \"AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x64.exe\"\n\nWr"
  },
  {
    "path": ".ci/install-r-deps.R",
    "chars": 3538,
    "preview": "# Install R dependencies, using only base R.\n#\n# Supported arguments:\n#\n#  --all                     Install all the 'De"
  },
  {
    "path": ".ci/lint-all.sh",
    "chars": 519,
    "preview": "#!/bin/bash\n\nset -e -E -u -o pipefail\n\npwsh -command \"Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -SkipPubl"
  },
  {
    "path": ".ci/lint-powershell.ps1",
    "chars": 1686,
    "preview": "$ErrorActionPreference = 'Stop'\r\n\r\n$settings = @{\r\n    Severity = @(\r\n        'Information',\r\n        'Warning',\r\n      "
  },
  {
    "path": ".ci/lint-r-code.R",
    "chars": 6464,
    "preview": "loadNamespace(\"lintr\")\n\nargs <- commandArgs(\n    trailingOnly = TRUE\n)\nSOURCE_DIR <- args[[1L]]\n\nFILES_TO_LINT <- list.f"
  },
  {
    "path": ".ci/parameter-generator.py",
    "chars": 14979,
    "preview": "# coding: utf-8\n\"\"\"Helper script for generating config file and parameters list.\n\nThis script generates LightGBM/src/io/"
  },
  {
    "path": ".ci/pip-envs/requirements-latest.txt",
    "chars": 550,
    "preview": "# nightlies for: matplotlib, numpy, pandas, pyarrow, scipy, scikit-learn\n--extra-index-url https://pypi.anaconda.org/sci"
  },
  {
    "path": ".ci/pip-envs/requirements-oldest.txt",
    "chars": 314,
    "preview": "# oldest versions of dependencies published after\n# minimum supported Python version's first release,\n# for which there "
  },
  {
    "path": ".ci/rerun-workflow.sh",
    "chars": 1516,
    "preview": "#!/bin/bash\n#\n# [description]\n#     Rerun specified workflow for given pull request.\n#\n# [usage]\n#     rerun-workflow.sh"
  },
  {
    "path": ".ci/run-r-cmd-check.sh",
    "chars": 1243,
    "preview": "#!/bin/bash\n\nset -e -u -o pipefail\n\nPKG_TARBALL=\"${1}\"\ndeclare -i ALLOWED_CHECK_NOTES=${2}\n\n# 'R CMD check' redirects in"
  },
  {
    "path": ".ci/set-commit-status.sh",
    "chars": 1203,
    "preview": "#!/bin/bash\n#\n# [description]\n#     Set a status with a given name to the specified commit.\n#\n# [usage]\n#     set-commit"
  },
  {
    "path": ".ci/setup.sh",
    "chars": 5546,
    "preview": "#!/bin/bash\n\nset -e -E -u -o pipefail\n\n# defaults\nIN_UBUNTU_BASE_CONTAINER=${IN_UBUNTU_BASE_CONTAINER:-\"false\"}\nSETUP_CO"
  },
  {
    "path": ".ci/test-python-latest.sh",
    "chars": 338,
    "preview": "#!/bin/bash\n\nset -e -E -u -o pipefail\n\necho \"installing lightgbm and its dependencies\"\npip install \\\n    --prefer-binary"
  },
  {
    "path": ".ci/test-python-oldest.sh",
    "chars": 887,
    "preview": "#!/bin/bash\n\nset -e -E -u -o pipefail\n\necho \"installing lightgbm and its dependencies\"\npip install \\\n    --prefer-binary"
  },
  {
    "path": ".ci/test-r-package-valgrind.sh",
    "chars": 3220,
    "preview": "#!/bin/bash\n\nset -e -E -u -o pipefail\n\nRDscriptvalgrind ./.ci/install-r-deps.R --test || exit 1\nsh build-cran-package.sh"
  },
  {
    "path": ".ci/test-r-package-windows.ps1",
    "chars": 13678,
    "preview": "# Download a file and retry upon failure. This looks like\n# an infinite loop but CI-level timeouts will kill it\nfunction"
  },
  {
    "path": ".ci/test-r-package.sh",
    "chars": 8781,
    "preview": "#!/bin/bash\n\nset -e -E -u -o pipefail\n\n# defaults\nARCH=$(uname -m)\n\n# set up R environment\nexport CRAN_MIRROR=\"https://c"
  },
  {
    "path": ".ci/test-windows.ps1",
    "chars": 7859,
    "preview": "function Assert-Output {\n    param( [Parameter(Mandatory = $true)][bool]$success )\n    if (-not $success) {\n        $hos"
  },
  {
    "path": ".ci/test.sh",
    "chars": 11367,
    "preview": "#!/bin/bash\n\nset -e -E -o -u pipefail\n\n# defaults\nCONDA_ENV=\"test-env\"\nIN_UBUNTU_BASE_CONTAINER=${IN_UBUNTU_BASE_CONTAIN"
  },
  {
    "path": ".editorconfig",
    "chars": 436,
    "preview": "root = true\n\n[*]\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\nend_of_line = lf\nindent_sty"
  },
  {
    "path": ".git-blame-ignore-revs",
    "chars": 367,
    "preview": "# introduce ruff-format (#6308)\n6330d6269c81dfd4c96e664b99239b8ff39ccf91\n# enable ruff format on tests and examples (#63"
  },
  {
    "path": ".github/CODEOWNERS",
    "chars": 431,
    "preview": "# This file controls default reviewers for LightGBM code.\n# See https://help.github.com/en/articles/about-code-owners\n# "
  },
  {
    "path": ".github/ISSUE_TEMPLATE/BUG_REPORT.md",
    "chars": 466,
    "preview": "---\nname: Bug Report 🐞\nabout: Something isn't working as expected? Here is the right place to report.\n---\n\n## Descriptio"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/FEATURE_REQUEST.md",
    "chars": 640,
    "preview": "---\nname: Feature Request 💡\nabout: Suggest a new idea for the project.\nlabels: enhancement, feature-request\n---\n\n<!--\nPl"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 361,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: github-actions\n    directory: /\n    schedule:\n      interval: monthly\n    gro"
  },
  {
    "path": ".github/release-drafter.yml",
    "chars": 469,
    "preview": "name-template: 'v$NEXT_PATCH_VERSION'\ntag-template: 'v$NEXT_PATCH_VERSION'\ncategories:\n  - title: '💡 New Features'\n    l"
  },
  {
    "path": ".github/workflows/build.yml",
    "chars": 2301,
    "preview": "# builds core artifacts, intended to be attached to releases\n# or used by other workflows\nname: Build\n\non:\n  push:\n    b"
  },
  {
    "path": ".github/workflows/cpp.yml",
    "chars": 5060,
    "preview": "name: C++\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n\n# automatically cancel"
  },
  {
    "path": ".github/workflows/cuda.yml",
    "chars": 3094,
    "preview": "name: CUDA Version\n\non:\n  # Run manually by clicking a button in the UI\n  workflow_dispatch:\n\n# automatically cancel in-"
  },
  {
    "path": ".github/workflows/lock.yml",
    "chars": 2055,
    "preview": "name: 'Lock Inactive Threads'\n\non:\n  schedule:\n    # midnight UTC, every Wednesday, for Issues\n    - cron: '0 0 * * 3'\n "
  },
  {
    "path": ".github/workflows/lychee.yml",
    "chars": 1152,
    "preview": "name: Link checks\n\non:\n  # Run manually by clicking a button in the UI\n  workflow_dispatch:\n  # Run once a day at 8:00am"
  },
  {
    "path": ".github/workflows/no_response.yml",
    "chars": 978,
    "preview": "name: No Response Bot\n\npermissions:\n  issues: write\n  pull-requests: write\n\non:\n  issue_comment:\n    types: [created]\n  "
  },
  {
    "path": ".github/workflows/optional_checks.yml",
    "chars": 914,
    "preview": "name: Optional checks\n\non:\n  pull_request:\n    branches:\n      - master\n\njobs:\n  all-optional-checks-successful:\n    tim"
  },
  {
    "path": ".github/workflows/python_package.yml",
    "chars": 18382,
    "preview": "name: Python-package\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n\n# automatic"
  },
  {
    "path": ".github/workflows/r_configure.yml",
    "chars": 1772,
    "preview": "name: R generate configure\n\non:\n  workflow_dispatch:\n    inputs:\n      pr-branch:\n        type: string\n        descripti"
  },
  {
    "path": ".github/workflows/r_package.yml",
    "chars": 13194,
    "preview": "name: R-package\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n\n# automatically "
  },
  {
    "path": ".github/workflows/r_valgrind.yml",
    "chars": 3237,
    "preview": "name: R valgrind tests\n\n# 'run-name' is used here to distinguish in the API between different runs from forks.\n#\n# When "
  },
  {
    "path": ".github/workflows/release_drafter.yml",
    "chars": 474,
    "preview": "name: Release Drafter\n\npermissions:\n  contents: read\n\non:\n  push:\n    branches:\n      - master\n\njobs:\n  updateReleaseDra"
  },
  {
    "path": ".github/workflows/static_analysis.yml",
    "chars": 3470,
    "preview": "# contains non-functional tests, like checks on docs\n# and code style\nname: Static Analysis\n\non:\n  push:\n    branches:\n "
  },
  {
    "path": ".github/workflows/swig.yml",
    "chars": 3205,
    "preview": "name: SWIG\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n\n# automatically cance"
  },
  {
    "path": ".gitignore",
    "chars": 6747,
    "preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User"
  },
  {
    "path": ".gitmodules",
    "chars": 445,
    "preview": "[submodule \"include/boost/compute\"]\n\tpath = external_libs/compute\n\turl = https://github.com/boostorg/compute\n[submodule "
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 3099,
    "preview": "# exclude files which are auto-generated by build tools\nexclude: |\n  (?x)^(\n      build|\n      external_libs|\n      ligh"
  },
  {
    "path": ".readthedocs.yaml",
    "chars": 254,
    "preview": "version: 2\nbuild:\n  os: \"ubuntu-24.04\"\n  tools:\n    python: \"mambaforge-23.11\"\nconda:\n  environment: docs/env.yml\nformat"
  },
  {
    "path": ".typos.toml",
    "chars": 358,
    "preview": "default.extend-ignore-re = [\n  \"/Ot\",\n  \"mis-alignment\",\n  \"mis-spelled\",\n  \"posix-seh-rt\",\n]\n\n[default.extend-words]\nMA"
  },
  {
    "path": ".yamllint.yml",
    "chars": 277,
    "preview": "# default config: https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration\nextends: default\n\nr"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 30219,
    "preview": "option(USE_MPI \"Enable MPI-based distributed learning\" OFF)\noption(USE_OPENMP \"Enable OpenMP\" ON)\noption(USE_GPU \"Enable"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 4687,
    "preview": "# Microsoft Open Source Code of Conduct\n\nThis code of conduct outlines expectations for participation in Microsoft-manag"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1579,
    "preview": "# contributing\n\nLightGBM has been developed and used by many active community members.\n\nYour help is very valuable to ma"
  },
  {
    "path": "LICENSE",
    "chars": 1121,
    "preview": "The MIT License (MIT)\n\nCopyright (c) Microsoft Corporation\nCopyright (c) The LightGBM developers\n\nPermission is hereby g"
  },
  {
    "path": "MAINTAINING.md",
    "chars": 2124,
    "preview": "# maintaining\n\nThis document is for LightGBM maintainers.\n\n## Releasing\n\n### Step 1: Put up a Release PR\n\nCreate a pull "
  },
  {
    "path": "R-package/.Rbuildignore",
    "chars": 1458,
    "preview": "\\.appveyor\\.yml\nAUTOCONF_UBUNTU_VERSION\n^autom4te.cache/.*$\n^.*\\.bin\n^build_r.R$\n\\.clang-format\n^.*\\.clusterfuzzlite$\n^c"
  },
  {
    "path": "R-package/AUTOCONF_UBUNTU_VERSION",
    "chars": 7,
    "preview": "2.71-2\n"
  },
  {
    "path": "R-package/DESCRIPTION",
    "chars": 2858,
    "preview": "Package: lightgbm\nType: Package\nTitle: Light Gradient Boosting Machine\nVersion: ~~VERSION~~\nDate: ~~DATE~~\nAuthors@R: c("
  },
  {
    "path": "R-package/LICENSE",
    "chars": 51,
    "preview": "YEAR: 2016\nCOPYRIGHT HOLDER: Microsoft Corporation\n"
  },
  {
    "path": "R-package/NAMESPACE",
    "chars": 1833,
    "preview": "# Generated by roxygen2: do not edit by hand\n\nS3method(\"dimnames<-\",lgb.Dataset)\nS3method(dim,lgb.Dataset)\nS3method(dimn"
  },
  {
    "path": "R-package/R/aliases.R",
    "chars": 3260,
    "preview": "# Central location for parameter aliases.\n# See https://lightgbm.readthedocs.io/en/latest/Parameters.html#core-parameter"
  },
  {
    "path": "R-package/R/callback.R",
    "chars": 8576,
    "preview": "# constants that control naming in lists\n.EVAL_KEY <- function() {\n  return(\"eval\")\n}\n.EVAL_ERR_KEY <- function() {\n  re"
  },
  {
    "path": "R-package/R/lgb.Booster.R",
    "chars": 49164,
    "preview": "#' @importFrom R6 R6Class\n#' @importFrom utils modifyList\nBooster <- R6::R6Class(\n  classname = \"lgb.Booster\",\n  cloneab"
  },
  {
    "path": "R-package/R/lgb.DataProcessor.R",
    "chars": 2772,
    "preview": "DataProcessor <- R6::R6Class(\n  classname = \"lgb.DataProcessor\",\n  public = list(\n    factor_levels = NULL,\n\n    process"
  },
  {
    "path": "R-package/R/lgb.Dataset.R",
    "chars": 40797,
    "preview": "#' @name lgb_shared_dataset_params\n#' @title Shared Dataset parameter docs\n#' @description Parameter docs for fields use"
  },
  {
    "path": "R-package/R/lgb.Predictor.R",
    "chars": 16126,
    "preview": "#' @importFrom methods is new\n#' @importFrom R6 R6Class\n#' @importFrom utils read.delim\n#' @importClassesFrom Matrix dsp"
  },
  {
    "path": "R-package/R/lgb.convert_with_rules.R",
    "chars": 7412,
    "preview": "# [description] get all column classes of a data.table or data.frame.\n#               This function collapses the result"
  },
  {
    "path": "R-package/R/lgb.cv.R",
    "chars": 19313,
    "preview": "#' @importFrom R6 R6Class\nCVBooster <- R6::R6Class(\n  classname = \"lgb.CVBooster\",\n  cloneable = FALSE,\n  public = list("
  },
  {
    "path": "R-package/R/lgb.drop_serialized.R",
    "chars": 1080,
    "preview": "#' @name lgb.drop_serialized\n#' @title Drop serialized raw bytes in a LightGBM model object\n#' @description If a LightGB"
  },
  {
    "path": "R-package/R/lgb.importance.R",
    "chars": 2308,
    "preview": "#' @name lgb.importance\n#' @title Compute feature importance in a model\n#' @description Creates a \\code{data.table} of f"
  },
  {
    "path": "R-package/R/lgb.interprete.R",
    "chars": 6540,
    "preview": "#' @name lgb.interprete\n#' @title Compute feature contribution of prediction\n#' @description Computes feature contributi"
  },
  {
    "path": "R-package/R/lgb.make_serializable.R",
    "chars": 1070,
    "preview": "#' @name lgb.make_serializable\n#' @title Make a LightGBM object serializable by keeping raw bytes\n#' @description If a L"
  },
  {
    "path": "R-package/R/lgb.model.dt.tree.R",
    "chars": 6415,
    "preview": "#' @name lgb.model.dt.tree\n#' @title Parse a LightGBM model json dump\n#' @description Parse a LightGBM model json dump i"
  },
  {
    "path": "R-package/R/lgb.plot.importance.R",
    "chars": 3171,
    "preview": "#' @name lgb.plot.importance\n#' @title Plot feature importance as a bar graph\n#' @description Plot previously calculated"
  },
  {
    "path": "R-package/R/lgb.plot.interpretation.R",
    "chars": 4852,
    "preview": "#' @name lgb.plot.interpretation\n#' @title Plot feature contribution as a bar graph\n#' @description Plot previously calc"
  },
  {
    "path": "R-package/R/lgb.restore_handle.R",
    "chars": 1909,
    "preview": "#' @name lgb.restore_handle\n#' @title Restore the C++ component of a de-serialized LightGBM model\n#' @description After "
  },
  {
    "path": "R-package/R/lgb.train.R",
    "chars": 11846,
    "preview": "#' @name lgb.train\n#' @title Main training logic for LightGBM\n#' @description Low-level R interface to train a LightGBM "
  },
  {
    "path": "R-package/R/lightgbm.R",
    "chars": 17234,
    "preview": "#' @name lgb_shared_params\n#' @title Shared parameter docs\n#' @description Parameter docs shared by \\code{lgb.train}, \\c"
  },
  {
    "path": "R-package/R/metrics.R",
    "chars": 1504,
    "preview": "# [description] List of metrics known to LightGBM. The most up to date list can be found\n#               at https://ligh"
  },
  {
    "path": "R-package/R/multithreading.R",
    "chars": 2442,
    "preview": "#' @name setLGBMThreads\n#' @title Set maximum number of threads used by LightGBM\n#' @description LightGBM attempts to sp"
  },
  {
    "path": "R-package/R/utils.R",
    "chars": 7549,
    "preview": ".is_Booster <- function(x) {\n  return(all(c(\"R6\", \"lgb.Booster\") %in% class(x)))  # nolint: class_equals.\n}\n\n.is_Dataset"
  },
  {
    "path": "R-package/README.md",
    "chars": 21035,
    "preview": "# LightGBM R-package\n\n[![CRAN Version](https://www.r-pkg.org/badges/version/lightgbm)](https://cran.r-project.org/packag"
  },
  {
    "path": "R-package/cleanup",
    "chars": 29,
    "preview": "#!/bin/sh\nrm -f src/Makevars\n"
  },
  {
    "path": "R-package/configure",
    "chars": 90554,
    "preview": "#! /bin/sh\n# Guess values for system-dependent variables and create Makefiles.\n# Generated by GNU Autoconf 2.71 for ligh"
  },
  {
    "path": "R-package/configure.ac",
    "chars": 5291,
    "preview": "### configure.ac                    -*- Autoconf -*-\n# Template used by Autoconf to generate 'configure' script. For mor"
  },
  {
    "path": "R-package/configure.win",
    "chars": 2177,
    "preview": "# Script used to generate `Makevars.win` from `Makevars.win.in`\n# on Windows\n\n###########################\n# find compile"
  },
  {
    "path": "R-package/cran-comments.md",
    "chars": 40087,
    "preview": "# CRAN Submission History\n\n## v4.6.0 - Submission 1 - (February 13, 2025)\n\n### CRAN response\n\nAccepted to CRAN\n\n### Main"
  },
  {
    "path": "R-package/demo/00Index",
    "chars": 641,
    "preview": "basic_walkthrough               Basic feature walkthrough\nboost_from_prediction           Boosting from existing predict"
  },
  {
    "path": "R-package/demo/basic_walkthrough.R",
    "chars": 4639,
    "preview": "library(lightgbm)\n\n# We load in the agaricus dataset\n# In this example, we are aiming to predict whether a mushroom is e"
  },
  {
    "path": "R-package/demo/boost_from_prediction.R",
    "chars": 1272,
    "preview": "library(lightgbm)\n\n# Load in the agaricus dataset\ndata(agaricus.train, package = \"lightgbm\")\ndata(agaricus.test, package"
  },
  {
    "path": "R-package/demo/categorical_features_rules.R",
    "chars": 3739,
    "preview": "# Here we are going to try training a model with categorical features\n\n# Load libraries\nlibrary(data.table)\nlibrary(ligh"
  },
  {
    "path": "R-package/demo/cross_validation.R",
    "chars": 2194,
    "preview": "library(lightgbm)\n\n# load in the agaricus dataset\ndata(agaricus.train, package = \"lightgbm\")\ndata(agaricus.test, package"
  },
  {
    "path": "R-package/demo/early_stopping.R",
    "chars": 1845,
    "preview": "library(lightgbm)\n\n# Load in the agaricus dataset\ndata(agaricus.train, package = \"lightgbm\")\ndata(agaricus.test, package"
  },
  {
    "path": "R-package/demo/efficient_many_training.R",
    "chars": 1373,
    "preview": "# Efficient training means training without giving up too much RAM\n# In the case of many trainings (like 100+ models), R"
  },
  {
    "path": "R-package/demo/leaf_stability.R",
    "chars": 6498,
    "preview": "# We are going to look at how iterating too much might generate observation instability.\n# Obviously, we are in a contro"
  },
  {
    "path": "R-package/demo/multiclass.R",
    "chars": 1903,
    "preview": "library(lightgbm)\n\n# We load the default iris dataset shipped with R\ndata(iris)\n\n# We must convert factors to numeric\n# "
  },
  {
    "path": "R-package/demo/multiclass_custom_objective.R",
    "chars": 3417,
    "preview": "library(lightgbm)\n\n# We load the default iris dataset shipped with R\ndata(iris)\n\n# We must convert factors to numeric\n# "
  },
  {
    "path": "R-package/demo/weight_param.R",
    "chars": 3219,
    "preview": "# This demo R code is to provide a demonstration of hyperparameter adjustment\n# when scaling weights for appropriate lea"
  },
  {
    "path": "R-package/inst/Makevars",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "R-package/inst/make-r-def.R",
    "chars": 3009,
    "preview": "# [description]\n#     Create a definition file (.def) from a .dll file, using objdump.\n#\n# [usage]\n#\n#     Rscript make-"
  },
  {
    "path": "R-package/man/agaricus.test.Rd",
    "chars": 960,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lightgbm.R\n\\docType{data}\n\\name{agaricus.t"
  },
  {
    "path": "R-package/man/agaricus.train.Rd",
    "chars": 972,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lightgbm.R\n\\docType{data}\n\\name{agaricus.t"
  },
  {
    "path": "R-package/man/bank.Rd",
    "chars": 768,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lightgbm.R\n\\docType{data}\n\\name{bank}\n\\ali"
  },
  {
    "path": "R-package/man/dim.Rd",
    "chars": 926,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{dim.lgb.Dataset}\n\\alia"
  },
  {
    "path": "R-package/man/dimnames.lgb.Dataset.Rd",
    "chars": 1234,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{dimnames.lgb.Dataset}\n"
  },
  {
    "path": "R-package/man/getLGBMThreads.Rd",
    "chars": 1096,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/multithreading.R\n\\name{getLGBMThreads}\n\\al"
  },
  {
    "path": "R-package/man/get_field.Rd",
    "chars": 1625,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{get_field}\n\\alias{get_"
  },
  {
    "path": "R-package/man/lgb.Dataset.Rd",
    "chars": 3132,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{lgb.Dataset}\n\\alias{lg"
  },
  {
    "path": "R-package/man/lgb.Dataset.construct.Rd",
    "chars": 617,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{lgb.Dataset.construct}"
  },
  {
    "path": "R-package/man/lgb.Dataset.create.valid.Rd",
    "chars": 2909,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{lgb.Dataset.create.val"
  },
  {
    "path": "R-package/man/lgb.Dataset.save.Rd",
    "chars": 803,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{lgb.Dataset.save}\n\\ali"
  },
  {
    "path": "R-package/man/lgb.Dataset.set.categorical.Rd",
    "chars": 1155,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{lgb.Dataset.set.catego"
  },
  {
    "path": "R-package/man/lgb.Dataset.set.reference.Rd",
    "chars": 968,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{lgb.Dataset.set.refere"
  },
  {
    "path": "R-package/man/lgb.configure_fast_predict.Rd",
    "chars": 7252,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Booster.R\n\\name{lgb.configure_fast_pre"
  },
  {
    "path": "R-package/man/lgb.convert_with_rules.Rd",
    "chars": 2501,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.convert_with_rules.R\n\\name{lgb.convert"
  },
  {
    "path": "R-package/man/lgb.cv.Rd",
    "chars": 6818,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.cv.R\n\\name{lgb.cv}\n\\alias{lgb.cv}\n\\tit"
  },
  {
    "path": "R-package/man/lgb.drop_serialized.Rd",
    "chars": 1008,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.drop_serialized.R\n\\name{lgb.drop_seria"
  },
  {
    "path": "R-package/man/lgb.dump.Rd",
    "chars": 1416,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Booster.R\n\\name{lgb.dump}\n\\alias{lgb.d"
  },
  {
    "path": "R-package/man/lgb.get.eval.result.Rd",
    "chars": 1807,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Booster.R\n\\name{lgb.get.eval.result}\n\\"
  },
  {
    "path": "R-package/man/lgb.importance.Rd",
    "chars": 1378,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.importance.R\n\\name{lgb.importance}\n\\al"
  },
  {
    "path": "R-package/man/lgb.interprete.Rd",
    "chars": 1859,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.interprete.R\n\\name{lgb.interprete}\n\\al"
  },
  {
    "path": "R-package/man/lgb.load.Rd",
    "chars": 1404,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Booster.R\n\\name{lgb.load}\n\\alias{lgb.l"
  },
  {
    "path": "R-package/man/lgb.make_serializable.Rd",
    "chars": 1000,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.make_serializable.R\n\\name{lgb.make_ser"
  },
  {
    "path": "R-package/man/lgb.model.dt.tree.Rd",
    "chars": 2420,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.model.dt.tree.R\n\\name{lgb.model.dt.tre"
  },
  {
    "path": "R-package/man/lgb.plot.importance.Rd",
    "chars": 1947,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.plot.importance.R\n\\name{lgb.plot.impor"
  },
  {
    "path": "R-package/man/lgb.plot.interpretation.Rd",
    "chars": 2054,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.plot.interpretation.R\n\\name{lgb.plot.i"
  },
  {
    "path": "R-package/man/lgb.restore_handle.Rd",
    "chars": 1759,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.restore_handle.R\n\\name{lgb.restore_han"
  },
  {
    "path": "R-package/man/lgb.save.Rd",
    "chars": 1443,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Booster.R\n\\name{lgb.save}\n\\alias{lgb.s"
  },
  {
    "path": "R-package/man/lgb.slice.Dataset.Rd",
    "chars": 902,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{lgb.slice.Dataset}\n\\al"
  },
  {
    "path": "R-package/man/lgb.train.Rd",
    "chars": 6397,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.train.R\n\\name{lgb.train}\n\\alias{lgb.tr"
  },
  {
    "path": "R-package/man/lgb_predict_shared_params.Rd",
    "chars": 3445,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Booster.R\n\\name{lgb_predict_shared_par"
  },
  {
    "path": "R-package/man/lgb_shared_dataset_params.Rd",
    "chars": 1017,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{lgb_shared_dataset_par"
  },
  {
    "path": "R-package/man/lgb_shared_params.Rd",
    "chars": 6239,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lightgbm.R\n\\name{lgb_shared_params}\n\\alias"
  },
  {
    "path": "R-package/man/lightgbm.Rd",
    "chars": 7514,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lightgbm.R\n\\name{lightgbm}\n\\alias{lightgbm"
  },
  {
    "path": "R-package/man/predict.lgb.Booster.Rd",
    "chars": 7951,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Booster.R\n\\name{predict.lgb.Booster}\n\\"
  },
  {
    "path": "R-package/man/print.lgb.Booster.Rd",
    "chars": 507,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Booster.R\n\\name{print.lgb.Booster}\n\\al"
  },
  {
    "path": "R-package/man/setLGBMThreads.Rd",
    "chars": 1335,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/multithreading.R\n\\name{setLGBMThreads}\n\\al"
  },
  {
    "path": "R-package/man/set_field.Rd",
    "chars": 1718,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Dataset.R\n\\name{set_field}\n\\alias{set_"
  },
  {
    "path": "R-package/man/summary.lgb.Booster.Rd",
    "chars": 528,
    "preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/lgb.Booster.R\n\\name{summary.lgb.Booster}\n\\"
  },
  {
    "path": "R-package/pkgdown/_pkgdown.yml",
    "chars": 3157,
    "preview": "template:\n  params:\n    bootswatch: cerulean\n\nsite:\n  root: ''\n  title: LightGBM, Light Gradient Boosting Machine\n\nrepo:"
  },
  {
    "path": "R-package/recreate-configure.sh",
    "chars": 951,
    "preview": "#!/bin/bash\n\nset -e -E -u -o pipefail\n\n# recreates 'configure' from 'configure.ac'\n# this script should run on Ubuntu 22"
  },
  {
    "path": "R-package/src/Makevars.in",
    "chars": 1349,
    "preview": "CXX_STD = CXX17\n\nPKGROOT=.\n\nLGB_CPPFLAGS = \\\n    @LGB_CPPFLAGS@ \\\n    -DUSE_SOCKET \\\n    -DLGB_R_BUILD\n\nPKG_CPPFLAGS = \\"
  },
  {
    "path": "R-package/src/Makevars.win.in",
    "chars": 1404,
    "preview": "CXX_STD = CXX17\n\nPKGROOT=.\n\nLGB_CPPFLAGS = \\\n    @LGB_CPPFLAGS@ \\\n    -DUSE_SOCKET \\\n    -DLGB_R_BUILD\n\nPKG_CPPFLAGS = \\"
  },
  {
    "path": "R-package/src/install.libs.R",
    "chars": 7485,
    "preview": "# User options\nuse_gpu <- FALSE\nmake_args_from_build_script <- character(0L)\n\n# For Windows, the package will be built w"
  },
  {
    "path": "R-package/src/lightgbm_R.cpp",
    "chars": 54283,
    "preview": "/*!\n * Copyright (c) 2017-2026 Microsoft Corporation. All rights reserved.\n * Copyright (c) 2017-2026 The LightGBM devel"
  },
  {
    "path": "R-package/src/lightgbm_R.h",
    "chars": 27435,
    "preview": "/*!\n * Copyright (c) 2017-2026 Microsoft Corporation. All rights reserved.\n * Copyright (c) 2017-2026 The LightGBM devel"
  },
  {
    "path": "R-package/tests/testthat/helper.R",
    "chars": 1752,
    "preview": "# ref for this file:\n#\n# * https://r-pkgs.org/testing-design.html#testthat-helper-files\n# * https://r-pkgs.org/testing-d"
  },
  {
    "path": "R-package/tests/testthat/test_Predictor.R",
    "chars": 23747,
    "preview": "library(Matrix)\n\ntest_that(\"Predictor's finalizer should not fail\", {\n    X <- as.matrix(as.integer(iris[, \"Species\"]), "
  },
  {
    "path": "R-package/tests/testthat/test_basic.R",
    "chars": 113199,
    "preview": "data(agaricus.train, package = \"lightgbm\")\ndata(agaricus.test, package = \"lightgbm\")\ntrain <- agaricus.train\ntest <- aga"
  },
  {
    "path": "R-package/tests/testthat/test_custom_objective.R",
    "chars": 3037,
    "preview": "data(agaricus.train, package = \"lightgbm\")\ndata(agaricus.test, package = \"lightgbm\")\ndtrain <- lgb.Dataset(agaricus.trai"
  },
  {
    "path": "R-package/tests/testthat/test_dataset.R",
    "chars": 20428,
    "preview": "data(agaricus.train, package = \"lightgbm\")\ntrain_data <- agaricus.train$data[seq_len(1000L), ]\ntrain_label <- agaricus.t"
  },
  {
    "path": "R-package/tests/testthat/test_learning_to_rank.R",
    "chars": 5655,
    "preview": "test_that(\"learning-to-rank with lgb.train() works as expected\", {\n    set.seed(708L)\n    data(agaricus.train, package ="
  },
  {
    "path": "R-package/tests/testthat/test_lgb.Booster.R",
    "chars": 55070,
    "preview": "test_that(\"Booster's finalizer should not fail\", {\n    X <- as.matrix(as.integer(iris[, \"Species\"]), ncol = 1L)\n    y <-"
  },
  {
    "path": "R-package/tests/testthat/test_lgb.convert_with_rules.R",
    "chars": 11183,
    "preview": "test_that(\"lgb.convert_with_rules() rejects inputs that are not a data.table or data.frame\", {\n    bad_inputs <- list(\n "
  },
  {
    "path": "R-package/tests/testthat/test_lgb.importance.R",
    "chars": 974,
    "preview": "test_that(\"lgb.importance() should reject bad inputs\", {\n    bad_inputs <- list(\n        .Machine$integer.max\n        , "
  },
  {
    "path": "R-package/tests/testthat/test_lgb.interprete.R",
    "chars": 3731,
    "preview": ".sigmoid <- function(x) {\n    1.0 / (1.0 + exp(-x))\n}\n.logit <- function(x) {\n    log(x / (1.0 - x))\n}\n\ntest_that(\"lgb.i"
  },
  {
    "path": "R-package/tests/testthat/test_lgb.model.dt.tree.R",
    "chars": 5131,
    "preview": "NROUNDS <- 10L\nMAX_DEPTH <- 3L\nN <- nrow(iris)\nX <- data.matrix(iris[2L:4L])\nFEAT <- colnames(X)\nNCLASS <- nlevels(iris["
  },
  {
    "path": "R-package/tests/testthat/test_lgb.plot.importance.R",
    "chars": 1409,
    "preview": "test_that(\"lgb.plot.importance() should run without error for well-formed inputs\", {\n    data(agaricus.train, package = "
  },
  {
    "path": "R-package/tests/testthat/test_lgb.plot.interpretation.R",
    "chars": 2923,
    "preview": ".sigmoid <- function(x) {\n    1.0 / (1.0 + exp(-x))\n}\n.logit <- function(x) {\n    log(x / (1.0 - x))\n}\n\ntest_that(\"lgb.p"
  },
  {
    "path": "R-package/tests/testthat/test_metrics.R",
    "chars": 389,
    "preview": "test_that(\".METRICS_HIGHER_BETTER() should be well formed\", {\n    metrics <- .METRICS_HIGHER_BETTER()\n    metric_names <"
  },
  {
    "path": "R-package/tests/testthat/test_multithreading.R",
    "chars": 470,
    "preview": "test_that(\"getLGBMthreads() and setLGBMthreads() work as expected\", {\n    # works with integer input\n    ret <- setLGBMt"
  },
  {
    "path": "R-package/tests/testthat/test_parameters.R",
    "chars": 5763,
    "preview": "data(agaricus.train, package = \"lightgbm\")\ndata(agaricus.test, package = \"lightgbm\")\ntrain <- agaricus.train\ntest <- aga"
  },
  {
    "path": "R-package/tests/testthat/test_utils.R",
    "chars": 5699,
    "preview": "test_that(\".params2str() works as expected for empty lists\", {\n    out_str <- .params2str(\n        params = list()\n    )"
  },
  {
    "path": "R-package/tests/testthat/test_weighted_loss.R",
    "chars": 1405,
    "preview": "test_that(\"Gamma regression reacts on 'weight'\", {\n  n <- 100L\n  set.seed(87L)\n  X <- matrix(runif(2L * n), ncol = 2L)\n "
  },
  {
    "path": "R-package/tests/testthat.R",
    "chars": 210,
    "preview": "library(testthat)\nlibrary(lightgbm)  # nolint: unused_import.\n\ntest_check(\n    package = \"lightgbm\"\n    , stop_on_failur"
  },
  {
    "path": "R-package/vignettes/basic_walkthrough.Rmd",
    "chars": 3472,
    "preview": "---\ntitle:\n  \"Basic Walkthrough\"\ndescription: >\n  This vignette describes how to train a LightGBM model for binary class"
  },
  {
    "path": "README.md",
    "chars": 12912,
    "preview": "<img src=https://github.com/lightgbm-org/LightGBM/blob/master/docs/logo/LightGBM_logo_black_text.svg width=300 />\n\n> [!N"
  },
  {
    "path": "SECURITY.md",
    "chars": 2756,
    "preview": "<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->\n\n## Security\n\nMicrosoft takes the security of our software products an"
  },
  {
    "path": "VERSION.txt",
    "chars": 9,
    "preview": "4.6.0.99\n"
  },
  {
    "path": "biome.json",
    "chars": 726,
    "preview": "{\n    \"root\": false,\n    \"vcs\": {\n        \"enabled\": true,\n        \"clientKind\": \"git\",\n        \"useIgnoreFile\": true\n  "
  },
  {
    "path": "build-cran-package.sh",
    "chars": 6600,
    "preview": "#!/bin/sh\n\n# [description]\n#     Prepare a source distribution of the R-package\n#     to be submitted to CRAN.\n#\n# [argu"
  },
  {
    "path": "build-python.sh",
    "chars": 13918,
    "preview": "#!/bin/sh\n\n# [description]\n#\n#     Prepare a source distribution (sdist) or built distribution (wheel)\n#     of the Pyth"
  },
  {
    "path": "build_r.R",
    "chars": 12415,
    "preview": "# For macOS users who have decided to use gcc\n# (replace 8 with version of gcc installed on your machine)\n# NOTE: your g"
  },
  {
    "path": "cmake/IntegratedOpenCL.cmake",
    "chars": 6521,
    "preview": "set(BUILD_SHARED_LIBS OFF CACHE BOOL \"\" FORCE)\nset(BOOST_VERSION_DOT \"1.74\")\nstring(REPLACE \".\" \"_\" BOOST_VERSION_UNDERS"
  },
  {
    "path": "cmake/Sanitizer.cmake",
    "chars": 1645,
    "preview": "# Set appropriate compiler and linker flags for sanitizers.\n#\n# Usage of this module:\n#  enable_sanitizers(\"address;leak"
  },
  {
    "path": "cmake/modules/FindLibR.cmake",
    "chars": 7301,
    "preview": "# CMake module used to find the location of R's\n# dll and header files.\n#\n# Borrows heavily from xgboost's R package:\n#\n"
  },
  {
    "path": "cmake/modules/FindNCCL.cmake",
    "chars": 2245,
    "preview": "#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance wit"
  },
  {
    "path": "docker/README.md",
    "chars": 4859,
    "preview": "# Using LightGBM via Docker\n\nThis directory contains `Dockerfile`s to make it easy to build and run LightGBM via [Docke"
  },
  {
    "path": "docker/dockerfile-cli",
    "chars": 883,
    "preview": "FROM ubuntu:20.04\n\nENV \\\n    DEBIAN_FRONTEND=noninteractive \\\n    LANG=C.UTF-8 \\\n    LC_ALL=C.UTF-8\n\nRUN apt-get update "
  },
  {
    "path": "docker/dockerfile-python",
    "chars": 1045,
    "preview": "FROM ubuntu:20.04\n\nARG CONDA_DIR=/opt/miniforge\n\nENV \\\n    DEBIAN_FRONTEND=noninteractive \\\n    LANG=C.UTF-8 \\\n    LC_AL"
  },
  {
    "path": "docker/dockerfile-r",
    "chars": 462,
    "preview": "ARG R_VERSION=latest\nFROM rocker/verse:${R_VERSION}\n\nRUN apt-get update && \\\n    apt-get install -y --no-install-recomme"
  },
  {
    "path": "docker/gpu/README.md",
    "chars": 1742,
    "preview": "# Tiny Distroless Dockerfile for LightGBM GPU CLI-only Version\r\n\r\n`dockerfile-cli-only-distroless.gpu` - A multi-stage b"
  },
  {
    "path": "docker/gpu/dockerfile-cli-only-distroless.gpu",
    "chars": 2986,
    "preview": "# Copyright (c) 2020 The Rector and Visitors of the University of Virginia\n#\n# Permission is hereby granted, free of cha"
  },
  {
    "path": "docker/gpu/dockerfile-cli-only.gpu",
    "chars": 2515,
    "preview": "# Copyright (c) 2020 The Rector and Visitors of the University of Virginia\n#\n# Permission is hereby granted, free of cha"
  },
  {
    "path": "docker/gpu/dockerfile.gpu",
    "chars": 5425,
    "preview": "FROM nvidia/cuda:8.0-cudnn5-devel\n\n#####################################################################################"
  },
  {
    "path": "docs/.lychee.toml",
    "chars": 966,
    "preview": "verbose = \"info\"\nno_progress = false\ncache = false\nscheme = [\"http\", \"https\", \"file\"]\ninclude_mail = false\ninclude_fragm"
  },
  {
    "path": "docs/Advanced-Topics.rst",
    "chars": 7479,
    "preview": "Advanced Topics\n===============\n\nMissing Value Handle\n--------------------\n\n-  LightGBM enables the missing value handle"
  },
  {
    "path": "docs/C-API.rst",
    "chars": 38,
    "preview": "C API\n=====\n\n.. doxygenfile:: c_api.h\n"
  },
  {
    "path": "docs/Development-Guide.rst",
    "chars": 7841,
    "preview": "Development Guide\n=================\n\nAlgorithms\n----------\n\nRefer to `Features <./Features.rst>`__ for understanding of "
  },
  {
    "path": "docs/Experiments.rst",
    "chars": 12445,
    "preview": "Experiments\n===========\n\nComparison Experiment\n---------------------\n\nFor the detailed experiment scripts and output log"
  },
  {
    "path": "docs/FAQ.rst",
    "chars": 22879,
    "preview": ".. role:: raw-html(raw)\n    :format: html\n\nLightGBM FAQ\n############\n\n.. contents:: LightGBM Frequently Asked Questions\n"
  }
]

// ... and 309 more files (download for full content)

About this extraction

This page contains the full source code of the lightgbm-org/LightGBM GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 509 files (16.7 MB), approximately 4.0M tokens, and a symbol index with 1754 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!