Search⌘ K
AI Features

Evaluating XGBoost with tidymodels

Understand how to implement and evaluate XGBoost machine learning models in R using tidymodels. Explore cross-validation methods and hyperparameter tuning to improve model accuracy and reliability, with practical application to the Titanic dataset.

We'll cover the following...

Cross-validation

Cross-validation is the best practice for evaluating the quality of machine learning models. XGBoost ensembles are no exception to this rule. The following code performs these processes:

  1. Prepares the Titanic training data.

  2. Specifies the XGBoost classification ensemble with hyperparameter tuning.

  3. Creates a tuning grid.

  4. Performs five-fold cross-validation for each row of the tuning grid.

  5. Outputs the best ten combinations of hyperparameters in terms of ...