Predicting Weekly Hotel Cancellations with XGBRegressor

Predicting Weekly Hotel Cancellations with XGBRegressor

XGBoost can also be used for time series forecasting. This is done by using lags of the time series of interest as separate features in the model. Let’s see how XGBRegressor can be used to help us predict hotel cancellations.

XGBoost is most commonly used for classification or regression-based problems, whereby features are incorporated into the model to predict an outcome of interest.

That said, XGBoost can also be used for time series forecasting. This is done by using lags of the time series of interest as separate features in the model. Let’s see how XGBRegressor can be used to help us predict hotel cancellations.

Data Processing

The below analysis is based on data from Antonio, Almeida and Nunes (2019): Hotel booking demand datasets.

The purpose of building a time series forecasting model with XGBoost is to allow the hotel in question to predict the number of hotel cancellations on a weekly basis.

The data is first split into training and validation partitions:

train_size = int(len(df) * 0.8)
val_size = len(df) - train_size
train, val = df[0:train_size,:], df[train_size:len(df),:]
Given that we are working with a [tree-based model](https://github.com/dmlc/xgboost/issues/357), the features are not normalized with MinMaxScaler under this example.

gradient-boosting machine-learning data-science timeseries

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Most popular Data Science and Machine Learning courses — July 2020

Most popular Data Science and Machine Learning courses — August 2020. This list was last updated in August 2020 — and will be updated regularly so as to keep it relevant

15 Machine Learning and Data Science Project Ideas with Datasets

Learning is a new fun in the field of Machine Learning and Data Science. In this article, we’ll be discussing 15 machine learning and data science projects.

Gradient Descent for Data Science and Machine Learning

Gradient Descent for Data Science and Machine Learning. Solve Optimization Problems using Gradient Descent. You might not find it super exciting in and of itself, but it will enable us to do exciting things throughout the article, so bear with me.

ML Optimization pt.1 - Gradient Descent with Python

In this article, we explore gradient descent - the grandfather of all optimization techniques and it’s variations. We implement them from scratch with Python.

Best Free Datasets for Data Science and Machine Learning Projects

This post will help you in finding different websites where you can easily get free Datasets to practice and develop projects in Data Science and Machine Learning.