Book Image

Machine Learning with LightGBM and Python

By : Andrich van Wyk
3 (1)
Book Image

Machine Learning with LightGBM and Python

3 (1)
By: Andrich van Wyk

Overview of this book

Machine Learning with LightGBM and Python is a comprehensive guide to learning the basics of machine learning and progressing to building scalable machine learning systems that are ready for release. This book will get you acquainted with the high-performance gradient-boosting LightGBM framework and show you how it can be used to solve various machine-learning problems to produce highly accurate, robust, and predictive solutions. Starting with simple machine learning models in scikit-learn, you’ll explore the intricacies of gradient boosting machines and LightGBM. You’ll be guided through various case studies to better understand the data science processes and learn how to practically apply your skills to real-world problems. As you progress, you’ll elevate your software engineering skills by learning how to build and integrate scalable machine-learning pipelines to process data, train models, and deploy them to serve secure APIs using Python tools such as FastAPI. By the end of this book, you’ll be well equipped to use various -of-the-art tools that will help you build production-ready systems, including FLAML for AutoML, PostgresML for operating ML pipelines using Postgres, high-performance distributed training and serving via Dask, and creating and running models in the Cloud with AWS Sagemaker.
Table of Contents (17 chapters)
1
Part 1: Gradient Boosting and LightGBM Fundamentals
6
Part 2: Practical Machine Learning with LightGBM
10
Part 3: Production-ready Machine Learning with LightGBM

Building LightGBM models

This section provides an end-to-end example of solving a real-world problem using LightGBM. We provide a more detailed look at data preparation for a problem and explain how to find suitable parameters for our algorithms. We use multiple variants of LightGBM to explore relative performance and compare them against random forests.

Cross-validation

Before we delve into solving a problem, we need to discuss a better way of validating algorithm performance. Splitting the data into two or three subsets is standard practice when training a model. The training data is used to train the model, the validation data is a hold-out set used to validate the data during training, and the test data is used to validate the performance after training.

In previous examples, we have done this split only once, building a single training and test to train and validate the model. The issue with this approach is that our model could get “lucky.” If, by chance...