All Projects → siboehm → lleaves

siboehm / lleaves

Licence: MIT License
Compiler for LightGBM gradient-boosted trees, based on LLVM. Speeds up prediction by ≥10x.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to lleaves

Lightgbm
A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.
Stars: ✭ 13,293 (+9970.45%)
Mutual labels:  lightgbm, decision-trees, gradient-boosting
stackgbm
🌳 Stacked Gradient Boosting Machines
Stars: ✭ 24 (-81.82%)
Mutual labels:  lightgbm, decision-trees, gradient-boosting
Awesome Gradient Boosting Papers
A curated list of gradient boosting research papers with implementations.
Stars: ✭ 704 (+433.33%)
Mutual labels:  lightgbm, gradient-boosting
Leaves
pure Go implementation of prediction part for GBRT (Gradient Boosting Regression Trees) models from popular frameworks
Stars: ✭ 261 (+97.73%)
Mutual labels:  lightgbm, decision-trees
Awesome Decision Tree Papers
A collection of research papers on decision, classification and regression trees with implementations.
Stars: ✭ 1,908 (+1345.45%)
Mutual labels:  lightgbm, gradient-boosting
Chefboost
A Lightweight Decision Tree Framework supporting regular algorithms: ID3, C4,5, CART, CHAID and Regression Trees; some advanced techniques: Gradient Boosting (GBDT, GBRT, GBM), Random Forest and Adaboost w/categorical features support for Python
Stars: ✭ 176 (+33.33%)
Mutual labels:  decision-trees, gradient-boosting
Auto ml
[UNMAINTAINED] Automated machine learning for analytics & production
Stars: ✭ 1,559 (+1081.06%)
Mutual labels:  lightgbm, gradient-boosting
autogbt-alt
An experimental Python package that reimplements AutoGBT using LightGBM and Optuna.
Stars: ✭ 76 (-42.42%)
Mutual labels:  lightgbm, gradient-boosting
Apartment-Interest-Prediction
Predict people interest in renting specific NYC apartments. The challenge combines structured data, geolocalization, time data, free text and images.
Stars: ✭ 17 (-87.12%)
Mutual labels:  lightgbm, gradient-boosting
decision-trees-for-ml
Building Decision Trees From Scratch In Python
Stars: ✭ 61 (-53.79%)
Mutual labels:  lightgbm, gradient-boosting
aws-machine-learning-university-dte
Machine Learning University: Decision Trees and Ensemble Methods
Stars: ✭ 119 (-9.85%)
Mutual labels:  lightgbm, decision-trees
yggdrasil-decision-forests
A collection of state-of-the-art algorithms for the training, serving and interpretation of Decision Forest models.
Stars: ✭ 156 (+18.18%)
Mutual labels:  decision-trees, gradient-boosting
dmjit
.dmJIT is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle! (formerly known as dm-jitaux)
Stars: ✭ 18 (-86.36%)
Mutual labels:  llvm
xgboost-lightgbm-hyperparameter-tuning
Bayesian Optimization and Grid Search for xgboost/lightgbm
Stars: ✭ 40 (-69.7%)
Mutual labels:  lightgbm
Amazon-Fine-Food-Review
Machine learning algorithm such as KNN,Naive Bayes,Logistic Regression,SVM,Decision Trees,Random Forest,k means and Truncated SVD on amazon fine food review
Stars: ✭ 28 (-78.79%)
Mutual labels:  decision-trees
Kaggle-Competition-Sberbank
Top 1% rankings (22/3270) code sharing for Kaggle competition Sberbank Russian Housing Market: https://www.kaggle.com/c/sberbank-russian-housing-market
Stars: ✭ 31 (-76.52%)
Mutual labels:  lightgbm
llvm-hs-typed
Type Safe LLVM IR ( Experimental )
Stars: ✭ 47 (-64.39%)
Mutual labels:  llvm
QuantumForest
Fast Differentiable Forest lib with the advantages of both decision trees and neural networks
Stars: ✭ 63 (-52.27%)
Mutual labels:  decision-trees
lsif-clang
Language Server Indexing Format (LSIF) generator for C, C++ and Objective C
Stars: ✭ 28 (-78.79%)
Mutual labels:  llvm
influence boosting
Supporting code for the paper "Finding Influential Training Samples for Gradient Boosted Decision Trees"
Stars: ✭ 57 (-56.82%)
Mutual labels:  gradient-boosting

lleaves 🍃

CI Documentation Status Downloads

A LLVM-based compiler for LightGBM decision trees.

lleaves converts trained LightGBM models to optimized machine code, speeding-up prediction by ≥10x.

Example

lgbm_model = lightgbm.Booster(model_file="NYC_taxi/model.txt")
%timeit lgbm_model.predict(df)
# 12.77s

llvm_model = lleaves.Model(model_file="NYC_taxi/model.txt")
llvm_model.compile()
%timeit llvm_model.predict(df)
# 0.90s 

Why lleaves?

  • Speed: Both low-latency single-row prediction and high-throughput batch-prediction.
  • Drop-in replacement: The interface of lleaves.Model is a subset of LightGBM.Booster.
  • Dependencies: llvmlite and numpy. LLVM comes statically linked.

Installation

conda install -c conda-forge lleaves or pip install lleaves (Linux and MacOS only).

Benchmarks

Ran on a dedicated Intel i7-4770 Haswell, 4 cores. Stated runtime is the minimum over 20.000 runs.

Dataset: NYC-taxi

mostly numerical features.

batchsize 1 10 100
LightGBM 52.31μs 84.46μs 441.15μs
ONNX Runtime 11.00μs 36.74μs 190.87μs
Treelite 28.03μs 40.81μs 94.14μs
lleaves 9.61μs 14.06μs 31.88μs

Dataset: MTPL2

mix of categorical and numerical features.

batchsize 10,000 100,000 678,000
LightGBM 95.14ms 992.47ms 7034.65ms
ONNX Runtime 38.83ms 381.40ms 2849.42ms
Treelite 38.15ms 414.15ms 2854.10ms
lleaves 5.90ms 56.96ms 388.88ms

Advanced usage

To avoid any Python overhead during prediction you can link directly against the generated binary. See benchmarks/c_bench/ for an example of how to do this. The function signature can change between major versions.

Development

conda env create
conda activate lleaves
pip install -e .
pre-commit install
./benchmarks/data/setup_data.sh
pytest
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].