liveBook · Manning

What you will learn in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

XGBoost, Deep Learning, and AI

by Luca Massaron,Mark Ryan

Chapter by chapter

Chapter 1: Understanding tabular data

1.1 What is tabular data? · 1.2 The world runs on tabular data · 1.3 Machine learning vs. deep learning · 1.4 What makes tabular data different? · 1.5 Generative AI and tabular data · 1.6 Summary

What you learn in chapter 1 →

Chapter 2: Exploring tabular datasets

2.1 Row and column characteristics · 2.1.1 The ideal criteria for tabular rows · 2.1.2 The ideal criteria for tabular columns · 2.1.3 Representing rows and columns · 2.2 Pathologies and remedies · 2.2.1 Constant or quasi-constant columns · 2.2.2 Duplicated and highly collinear features · 2.2.3 Irrelevant features · 2.2.4 Missing data · 2.2.5 Rare categories · 2.2.6 Errors in data · 2.2.7 Leakage features · 2.3 Finding external and internal data · 2.3.1 Using pandas to access data stores · 2.3.2 Internet data · 2.3.3 Synthetic data · 2.4 Exploratory data analysis · 2.4.1 Loading the Auto MPG example dataset · 2.4.2 Examining labels, values, distributions · 2.4.3 Exploring bivariate and multivariate relationships · 2.5 Summary

What you learn in chapter 2 →

Chapter 3: Machine learning vs. deep learning

3.1 Predicting Airbnb prices in New York City · 3.1.1 The Airbnb NYC dataset · 3.1.2 Introduction to the code · 3.1.3 A deep learning solution using Keras · 3.1.4 Training features · 3.1.5 Comparing gradient boosting and deep learning solutions · 3.1.6 Conclusions · 3.2 Transparency · 3.2.1 Explainability · 3.2.2 Feature importance · 3.2.3 Conclusions · 3.3 Efficacy · 3.3.1 Evaluating performance · 3.4 Digging Deeper · 3.5 Summary

What you learn in chapter 3 →

Chapter 4: Classical algorithms for tabular data

4.1 Introducing Scikit-learn · 4.1.1 Common features of Scikit-learn packages · 4.1.2 Common Scikit-learn interface · 4.1.3 Introduction to Scikit-learn pipelines · 4.2 Exploring and processing features of the Airbnb NYC dataset · 4.2.1 Dataset exploration · 4.2.2 Pipelines preparation · 4.3 Classical machine learning · 4.3.1 Linear and logistic regression · 4.3.2 Regularized methods · 4.3.3 Logistic regression · 4.3.4 Generalized linear methods · 4.3.5 Handling large datasets with stochastic gradient descent · 4.3.6 Choosing your algorithm · 4.4 Summary

What you learn in chapter 4 →

Chapter 5: Decision trees and gradient boosting

5.1 Introduction to tree-based methods · 5.1.1 Bagging and sampling · 5.1.2 Predicting with random forests · 5.1.3 Resorting to extremely randomized trees · 5.2 Gradient boosting · 5.2.1 How gradient boosting works · 5.2.2 Extrapolating with gradient boosting · 5.2.3 Explaining gradient boosting effectiveness · 5.3 Boosting in Scikit-learn · 5.3.1 Applying early stopping to avoid overfitting · 5.4 Using XGBoost · 5.4.1 XGBoost’s key parameters · 5.4.2 How XGBoost works · 5.4.3 Accelerating with histogram splitting · 5.4.4 Applying early stopping to XGBoost · 5.5 Introduction to LightGBM · 5.5.1 How LightGBM grows trees · 5.5.2 Gaining speed with exclusive feature bundling and gradient-based one-side sampling · 5.5.3 Applying early stopping to LightGBM · 5.5.4 Making XGBoost imitate LightGBM · 5.5.5 How LightGBM inspired Scikit-learn · 5.6 Summary

What you learn in chapter 5 →

Chapter 6: Advanced feature processing methods

6.1 Processing features · 6.1.1 Multivariate missing data imputation · 6.1.2 Handling missing data with GBDTs · 6.1.3 Target encoding · 6.1.4 Transforming numerical data · 6.2 Selecting features · 6.2.1 Stability selection for linear models · 6.2.2 Shadow features and Boruta · 6.2.3 Forward and backward selection · 6.3 Optimizing hyperparameters · 6.3.1 Searching systematically · 6.3.2 Using random trials · 6.3.3 Reducing the computational burden · 6.3.4 Extending your search by Bayesian methods · 6.3.5 Manually setting hyperparameters · 6.4 Mastering gradient boosting · 6.4.1 Deciding between XGBoost and LightGBM · 6.4.2 Exploring tree structures · 6.4.3 Speeding up by GBDTs and compiling · 6.5 Summary

What you learn in chapter 6 →

Chapter 7: An end-to-end example using XGBoost

7.1 Preparing and exploring your data · 7.1.1 Using generative AI to help prepare data · 7.1.2 Getting and preparing your data · 7.1.3 Engineering more complex features · 7.1.4 Finalizing your data · 7.1.5 Exploring and fixing your data · 7.1.6 Exploring your target · 7.2 Building and optimizing your model · 7.2.1 Preparing a cross-validation strategy · 7.2.2 Preparing your pipeline · 7.2.3 Building a baseline model · 7.2.4 Building a first tentative model · 7.2.5 Optimizing your model · 7.2.6 Training the final model · 7.3 Explaining your model with SHAP · 7.4 Summary

What you learn in chapter 7 →

Chapter 8: Getting started with deep learning with tabular data

8.1 The deep learning with tabular data stack · 8.2 PyTorch with fastai · 8.2.1 Reviewing the key code aspects of the fastai solution · 8.2.2 Comparing the fastai solution with the Keras solution · 8.3 PyTorch with TabNet · 8.3.1 Key code aspects of the TabNet solution · 8.3.2 Comparing the TabNet solution with the Keras solution · 8.4 PyTorch with Lightning Flash · 8.4.1 The key code aspects of the Lightning Flash solution · 8.4.2 Comparing the Lightning Flash solution with the Keras solution · 8.5 Overall comparison of the stacks · 8.6 The stacks we didn’t explore · 8.7 Summary

What you learn in chapter 8 →

Chapter 9: Deep learning best practices

9.1 Introduction to the Kuala Lumpur real estate dataset · 9.2 Processing the dataset · 9.2.1 Processing Bathrooms, Car Parks, Furnishing, Property Type, and Location columns · 9.2.2 Processing the Price column · 9.2.3 Processing the Rooms column · 9.2.4 Processing the Size column · 9.3 Defining the deep learning model · 9.3.1 Contrasting the custom layer and Keras preprocessing layer approaches · 9.3.2 Examining the code for model definition using Keras preprocessing layers · 9.4 Training the deep learning model · 9.4.1 Cross-validation in the training process · 9.4.2 Regularization in the training process · 9.4.3 Normalization in the training process · 9.5 Exercising the deep learning model · 9.5.1 Rationale for exercising the trained model on some new data points · 9.5.2 Exercising the trained model on some new data points · 9.6 Summary

What you learn in chapter 9 →

Chapter 10: Model deployment

10.1 A simple web deployment · 10.1.1 Overview of web deployment · 10.1.2 The Flask server module · 10.1.3 The home.html page · 10.1.4 The show-prediction.html page · 10.1.5 Exercising the web deployment · 10.2 Public clouds and machine learning operations · 10.3 Getting started with Google Cloud · 10.3.1 Accessing Google Cloud for the first time · 10.3.2 Creating a Google Cloud project · 10.3.3 Creating a Google Cloud Storage bucket · 10.4 Deploying a model in Vertex AI · 10.4.1 Uploading the model to a Cloud Storage bucket · 10.4.2 Importing the model to Vertex AI · 10.4.3 Deploying the model to an endpoint · 10.4.4 Initial test of the model deployment · 10.5 Using the Vertex AI deployment with Flask · 10.5.1 Setting up the Vertex AI SDK · 10.5.2 Updating the Flask server module to call the endpoint · 10.5.3 Benefits of deploying a model to an endpoint · 10.6 Gemini for Google Cloud: Generative AI assistance in Google Cloud · 10.6.1 Using Gemini for Google Cloud to answer questions about Google Cloud · 10.7 Summary

What you learn in chapter 10 →

Chapter 11: Building a machine learning pipeline

11.1 Introduction to ML pipelines · 11.1.1 Three kinds of pipelines · 11.1.2 Overview of Vertex AI ML pipelines · 11.2 ML pipeline preparation steps · 11.2.1 Creating a service account for the ML pipeline · 11.2.2 Creating a service account key · 11.2.3 Granting the service account access to the Compute Engine default service account · 11.2.4 Introduction to Cloud Shell · 11.2.5 Uploading the service account key · 11.2.6 Uploading the cleaned-up dataset to a Google Cloud Storage bucket · 11.2.7 Creating a Vertex AI managed dataset · 11.3 Defining the ML pipeline · 11.3.1 Local implementation vs. ML pipeline · 11.3.2 Introduction to containers · 11.3.3 Benefits of using containers in an ML pipeline · 11.3.4 Introduction to adapting code to run in a container · 11.3.5 Updating the training code to work in a container · 11.3.6 The pipeline script · 11.3.7 Testing the model trained in the pipeline · 11.4 Using generative AI to help create the ML pipeline · 11.4.1 Using Gemini for Google Cloud to answer questions about the ML pipeline · 11.4.2 Using Gemini for Google Cloud to generate code for the ML pipeline · 11.4.3 Using Gemini for Google Cloud to explain code for the ML pipeline · 11.4.4 Using Gemini for Google Cloud to summarize log entries · 11.4.5 Tuning a foundation model in Vertex AI · 11.5 Summary

What you learn in chapter 11 →

Chapter 12: Blending gradient boosting and deep learning

12.1 Review of the gradient boosting solution from chapter 7 · 12.2 Selecting a deep learning solution · 12.3 Selected deep learning solution to the Tokyo Airbnb problem · 12.4 Comparing the XGBoost and fastai solutions to the Tokyo Airbnb problem · 12.5 Ensembling the two solutions to the Tokyo Airbnb problem · 12.6 Overall comparison of gradient boosting and deep learning · 12.7 Summary

What you learn in chapter 12 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.