Who this book is for
This book is for data science professionals and enthusiasts, data analysts, and developers who want to build fast and accurate machine learning models that scale with big data. Proficiency in Python along with a basic understanding of linear algebra will help you to get the most out of this book.
What this book covers
Chapter 1, Machine Learning Landscape, presents XGBoost within the general context of machine learning by introducing linear regression and logistic regression before comparing results with XGBoost. pandas
is introduced to preprocess raw data for machine learning by converting categorical columns and clearing null values in a variety of ways.
Chapter 2, Decision Trees in Depth, presents a detailed examination of decision tree hyperparameters that are used by XGBoost, along with a graphical and statistical analysis of variance and bias that highlights the importance of overfitting, a theme touched on throughout the book.
Chapter 3, Bagging with Random Forests, presents a general survey of random forests as an XGBoost competitor with a focus on bagging. Additional XGBoost hyperparameters shared with random forests such as n_esimtators
and subsample
are thoroughly covered.
Chapter 4, From Gradient Boosting to XGBoost, covers boosting fundamentals, building a booster from scratch in scikit-learn
, fine-tuning new XGBoost hyperparameters such as eta
, and comparing runtimes between gradient boosting and XGBoost to highlight XGBoost's impressive speed.
Chapter 5, XGBoost Unveiled, analyzes the mathematical derivations of XGBoost algorithms and features a historically relevant case study featuring XGBoost's role as the winning model in the Higgs Boson Kaggle Competition. Standard XGBoost parameters are discussed, base models are built, and the original Python API is covered.
Chapter 6, XGBoost Hyperparameters, covers all essential XGBoost hyperparameters, summarizes previous tree ensemble hyperparameters, and uses original grid search functions to fine-tune XGBoost models to optimize scores.
Chapter 7, Discovering Exoplanets with XGBoost, gives you the opportunity to discover exoplanets with XGBoost in a top-to-bottom case study. The pitfalls of imbalanced datasets are analyzed with the confusion matrix and classification report leading to different scoring metrics and the important XGBoost hyperparameter scale_pos_weight
.
Chapter 8, XGBoost Alternative Base Learners, covers the full range of XGBoost boosters including gbtree
, dart
, and gblinear
for regression and classification. Random forests are presented as base learners, and as XGBoost alternative models with the new XGBRFRegressor
and XGBRFClassifier
classes.
Chapter 9, XGBoost Kaggle Masters, presents tips and tricks that XGBoost Kaggle winners have used to win competitions such as advanced feature engineering, building non-correlated machine ensembles, and stacking.
Chapter 10, XGBoost Model Deployment, transforms raw data into XGBoost machine learning predictions through the use of customized transformers to handle mixed data and machine learning pipelines to make predictions on incoming data with a fine-tuned XGBoost model.