Giter Site home page Giter Site logo

fast-lightgbm-inference's Introduction

Fast Lightgbm Inference

This project contains a practical application of running a Lightgbm model in production for very quick inference. Running the feature transformation and training the model with Lightgbm happens in Python. A deterministic data transformer is used for this, and the same one is reused in the application serving predictions. Both the feature pipeline config and the model can be updated without any downtime of the server.

There are 3 components:

  1. feature-pipe: a library with the definitions of the feature config and deterministic data transformations written in Rust.
  2. rust-transformer: containing Rust-Numpy bindings from the feature-pipe, along with a Python scikit-learn transformer and some other utility code. It compiles to the Python ODT module.
  3. main application: Actix-Web application for making online predictions and updating model/configuration.

Quickstart

  1. Running the server

    Run 'cargo run' or build the image and run with Docker.

  2. Training a model in Python and sending model/config to the server

    cargo install maturin
    cd rust-transformer
    maturin build
    cd ..
    poetry install

    And you should be good to go.

    For an example: see the notebook in examples/breast-cancer.

Running loadtests

locust -f main.py --host=http://localhost:8080

With distributed workers

locust -f main.py --master --host=http://localhost:8080 --users=10 --spawn-rate=2

./locust_workers.sh

fast-lightgbm-inference's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.