Fancy a trip to Menorca?

If you are planning a holiday trip to Menorca, I recommend you read this post about AirBnB accommodations prices in Menorca for 2020–2021.

Bernardo Garcia del Rio
7 min readJun 21, 2020

(Bonus — You will learn something about Data Science and Machine Learning along the way)

Cala Galdana in Menorca (Image by Author)

Balearic Islands are well-known for being one of the most expensive holiday destinations in Spain, particularly during Summer season.

In the first two parts of this post, I used publicly available data from AirBnB, data wrangling and descriptive statistics to answer the following questions:

  1. What is on average the summer price increase of AirBnB accommodations in Menorca?
  2. Can I overnight in Menorca for less than 35.00 USD? If so, where and in which type of accommodation?

In the third part, I take you through a theoretical business case where I was asked to develop a Machine Learning (ML) model for predicting mean accommodations prices.

The datasets and code related to this post can be found in my GitHub repository (Link at the end of the post).

What is on average the summer price increase of AirBnB accommodations in Menorca?

In my country, Spain, everyone knows that people who live and work in Balearic Islands and do not own a property do struggle with rent increases during summer season.

Therefore, it is sensible to assume that AirBnB accommodations prices in Menorca will be more expensive in summer but…How much expensive?

In order to answer this question, I used a time-series with all the prices of all the AirBnB accommodations listed in Menorca from May 2020 to May 2021.

The Line chart above shows the price mean values of all the AirBnB accommodations in Menorca over 1 year time. The red hatch around the line indicates the 95% confidence interval around the mean values.

Are on average AirBnB accommodations more expensive in summer? Yes, we can easily spot a peak in the curve in the summer season. Mean price starts to go up in May 2020 and reaches a peak in August, when the curve flattens. Mean price sharply declines at the end of August when the summer season ends.

We can make some easy calculations and conclude that, on average, AirBnB accommodations prices in Menorca are increased by 23.22% in 2021 summer when comparing them to 2020/2021 winter prices.

An interesting finding that we can also extract from the chart is that AirBnB accommodations in May 2021 are on average more expensive that in May 2020.

We could have expected higher prices in May 2021. However, something unexpected to me was that the 14.82% of the AirBnB accommodations in Menorca are actually cheaper in 2021 summer season, with higher prices in 2020/2021 winter season. (I found out this when calculating the average summer price increase.)

There might be two reasons behind this unexpected, at least to me, finding:

  • COVID-19: The pandemic is hitting hard on the Economy, specially on tourism businesses. Some AirBnB hosts might be reducing their prices as a mitigation measure.
  • Combination of unknown reasons: It might be that for several unknown reasons, some accommodations offer a lower price in summer. e.g. a new listed accommodation that overestimated its market value.

We can only speculate about this as there is not data available to get to a conclusion so…what are your thoughts?

Can I overnight in Menorca for less than 35.00 USD/night? If so, where and in which type of accommodation?

Given the fact that Balearic Islands climate is soft and temperatures are warm throughout the year, I was curious to see if it is possible to stay in an AirBnB accommodation in Menorca for less than 35.00 USD/night, regardless of the season.

I grouped the data by type of accommodation and plotted some bar charts showing lowest prices over the year.

Let’s imagine you are 20 and your gang wants to rent an entire home or apartment for a budget trip:

Wow! It seems there are quite a few choices such as Alaior, Ciutadella de Menorca and Es Mercadal so we could definitely rent an AirBnB entire home in Menorca for less than 35.00 USD a night.

Obviously, we would need to look deeper into the data to determine when these prices are available, condition of accommodation, etc..but it is possible!! After all, you don’t tend to think much about these things when you are 20!

What if you are thinking about a romantic weekend with your partner? A hotel seems a better choice..Can we find a budget hotel in Menorca?

Mmm..It is not gonna be that easy. We could find something in Ciutadella de Menorca but I am not sure it would be a good choice for a romantic weekend…

Finally, let’s take a look at the options if we are looking for a shared accommodation with private room:

We have many choices. We could find an accommodation for less than 35.00 USD/night pretty much everywhere in the island with only the exceptions of Alaior and Es Migjorn Gran areas.

To conclude, it is absolutely possible to find an AirBnB place for less than 35.00 USD a night, particularly if you are looking for an entire home/apartment or a shared accommodation with private room.

Let’s jump now into a theoretical business case where we could use ML.

Business Case — Can we use a ML model to determine the launch price of an accommodation on AirBnB?

(Note. In this part of the post, I am going to assume that the reader has a very high-level understanding of how ML and data can help businesses.)

Imagine that a friend of mine owns a property in Menorca and plans to list it on AirBnB next year to make an extra income.

He knows that I have a technical background and have been learning Data Science and ML, so he asks me to develop a model that can predict the mean accommodations prices during the period of 1 year.

Before giving him an answer, I want to make sure that this is actually feasible with the data available. (Public AirBnB datasets)

For non-technical people, ML models learn from data and then try to predict values when you pass them new data by using what they have learnt. (e.g. If I have a house in Ciutadella de Menorca with 5 bedrooms, 2 bathrooms and swimming pool, what is the AirBnB market price?)

Without going into much detail, these are the steps that I took in order to assess the feasibility of the project and select a promising model:

  1. First glance at the data: Here is where you try to get a general understanding of your data. It is a high-level exploration. You start to think about good predictors of price (the target variable), if they will be available for your case (e.g. If I want to predict the launch price, I cannot use data about customer reviews), etc.
  2. Splitting the dataset: In ML models, it is necessary to split the dataset into a training set and a test set (also known as validation set) in order to measure model performance on new data. If you train your model with all your data and you measure the model performance on the same data, it is highly likely that the model will not perform well on data that it has never seen before.
  3. Exploratory Data Analysis (EDA): This step is similar to step 1 but you go deeper into the data. You check for outliers (abnormal observations, e.g. that luxurious AirBnB apartment with sea views and jacuzzi) that can make difficult for ML models identifying patterns in the data, correlations with the target variable, etc. Here is when you decide the data your are going to use to train your model.
  4. Data Preparation: Preprocessing the data is very important in ML models. Here is when you impute or remove observations with missing values, encode categorical variables (transform categorical or text data into numerical data) and scale the data to have numerical data in the same order of magnitude.
  5. Select a promising model: You choose some ML models and measure their quality using different techniques. This is done on training data. Based on the results, you select the most promising model and move on to the next step.
  6. Evaluate model performance on test data: Finally, you trained the model and pass new data to the model in order to make predictions. You compared the predictions with the target values in the test set to determine the error.

So after going through these steps…Can we use a ML model to determine the launch price of an accommodation on AirBnB? Yes, we can. A Random Forest Regressor seems to be a promising model compared to a Decision Tree Regressor and a Gradient Boosting Model.

However, the model needs to be refined before being useful for my friend. The Root Mean Square Error (RMSE), a metric used to measure model’s performance, was 162.59 USD, which is not acceptable for most prices ranging from 75.00 USD to 210.00 USD.

The next steps to refine this model might be:

  • Get more training data, if possible.
  • Spend more time on feature selection. Try to combined attributes that could result in a better predictor of price.
  • Try different imputation methods.
  • Scale numerical variables using a different method.
  • Fine tune hyperparameters.

Datasets and Code

The datasets and code related to this post can be found in my GitHub repository at the link below:

https://github.com/bergr7/Project_1_AirBnB_Menorca

Note this project was part of the Udacity Nano-degree program in which I am enrolled to. Any feedback that could help me improve is well received and appreciated. Thanks for reading!!

--

--