Introduction

Airbnb has grown in popularity since its conception in 2008 as an alternative to traditional hotels, offering travellers broader options for accommodations, location, and amenities. Airbnb listings are managed by individual hosts who often own the property, setting their own prices and rules. Because of this, properties vary significantly in size and price, even within the same city. We will explore what characteristics are associated with the variance in nightly rental price for Airbnb properties within Austin, Texas. Machine learning provides us with computational algorithms that will let us determine the correlated characteristics and discover if we may be able to accurately predict rental prices given these variables.

The goal of our project is to investigate how accurately machine learning can predict the nightly price of an Airbnb listing based on its characteristics. A 2017 study published in the International Journal of Hospitality Management (Wang & Nicolau) explores a similar question using least squares regression on price with predictors property characteristics, host attributes, amenities, rules, and ratings in 33 cities throughout the world. This has applications in the broader economy to determine how such a wide variety of properties may be fairly and standardly priced. In 2021, a study in the Journal of Theoretical and Applied Electronic Commerce Research (Chang & Li) expanded on this study, utilizing machine learning algorithms like random forest and support vector regression to show that the marketing of a listing (pictures, titles, descriptions, proximity to tourist attractions) are all significant factors in pricing. They found that tree based models outperformed regression based models, which is very useful information for this study.

We will be using publicly available Airbnb data from Inside Airbnb, a community of researchers, journalists, and activists who seek to explore the impact of private rental homes on the housing market, communities, and economy. The website is updated quarterly with the listings scraped directly from the app by city. We will be using the most recent data from Austin Texas, collected during the third fiscal quarter of 2026 and published on September 17.

Data Preparation

knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)

# Load necessary libraries
library(factoextra)
library(tidyverse)
library(mosaic)
library(dplyr)
library(ggplot2)
library(GGally)

# Load Data
airbnb_albany_raw <- read_csv("~/Sds_272_F26/Project/Elijah_Rooney_Dylan/Airbnb_Listings_Reduced.csv")

# Clean Data
airbnb_albany_cleaned <- airbnb_albany_raw |>
  mutate(                           # Convert values to numbers
    price = parse_number(price),
    host_is_superhost = ifelse(host_is_superhost == TRUE,1,0),
    num_amenities = str_count(amenities, ",") + 1
  ) |>
  select(                            # Remove unhelpful variables
    -c(
      instant_bookable,
      city,
      property_type
    )
  ) |>
  filter(price < 500000) |>       # Remove high leverage points
  drop_na()

K-mean Clustering

K-mean Clustering is an algorithm that groups together data points by euclidean distance. It starts by choosing \(k\) random points in a multidimensional euclidean space, assigning each data point to it’s closest random point, recalculating each random points’ location by the average of the cluster, then iterating. Below, we attempt to establish a listing profile for various price ranges using clustering in 7 dimensions.

# Choose Variables to Include
cluster_vars <- c(
  "bedrooms", 
  "availability_rate", 
  "num_amenities",
  "number_of_reviews",
  "review_scores_rating",
  "minimum_nights",
  "host_is_superhost"
)

cluster_data <- airbnb_albany_cleaned |>
  select(all_of(cluster_vars)) |>
  na.omit()

# Standardize
cluster_scaled <- scale(cluster_data)

# Elbow Plot
display_elbow(cluster_scaled)
This plot has values of k along the x axis and total within-cluster Sum of Squares metric along the y. This demonstrates the higher amounts of clusters will group together points that are more similar in profile, but with diminishing granularity. There is a sharp elbow at k equals 2, and a pretty consistent slope approaching 0 as k goes to infinity.

Figure 1: Elbow Plot for Determining Optimal \(K\)

Above we have an elbow plot. This plot uses a metric, Sum of Squares, to tell us the information gain for each additional cluster we add to the algorithm. We can use this to decide on a value for \(k\) where returns start to diminish. We can see there is a clear elbow at \(k=2\), presumably because our binary variable host_is_superhost. Because we don’t want this to be our sole variable considered in clustering, we will look farther down the x axis and choose the point \(k=5\).

# Set RNG to be reproducable
set.seed(123)

# Perform Algorithm
km <- kmeans(cluster_scaled,
             centers = 5,
             nstart = 25,
             iter.max = 100)

# Add cluster Index as new column
airbnb_albany_cleaned <- airbnb_albany_cleaned |>
  mutate(cluster = factor(km$cluster))
airbnb_albany_cleaned |>
  filter(!is.na(cluster)) |>
  group_by(cluster) |>
  summarise(
    n = n(),
    across(all_of(cluster_vars), mean),
    mean_price = mean(price, na.rm = TRUE),
    median_price = median(price, na.rm = TRUE)
  )

Above, we have a table that groups by our k-mean clusters and summarizes the means of our 7 dimensions. Some noticable traits is that one cluster contains entirely superhost listings and one cluster contains entirely non-superhost listings. What is shocking is that these two groups have surprisingly similar median prices, although we will examine the distributions in a bit more detail in the next plot.

Another observation is that cluster 1 seems to contain the a small number of points compared to the others, capturing specifically listings with few and low ratings, few amenities, long required stays, and fewer bookings. This cluster also has few superhosts, possibly explaining these far from average traits.

Below, we show the cluster plot to visualize these distinct groups. The limitation to this plot, however, is that we have 7 dimensions and can only visualize 2, however it may provide some insight on why certain clusters have averages so far from that of other clusters.

fviz_cluster(
  km,
  data = cluster_scaled,
  geom = "point",
  axes = c(1,6),
  ellipse.type = "convex",
  ellipse.alpha = .1
)
Cluster Plot demonstrating the k-mean algorithm cluster results. It shows a 2-dimensional scatterplot with boundries drawn around our 5 clusters. Because this plot only shows 2 out of 7 dimensions, it appears that only two of the clusters are truly distinct, although this is not truly indicative of true results.

Figure 3: Cluster Plot

ggplot(filter(airbnb_albany_cleaned, !is.na(cluster)),
       aes(x = cluster, y = price, fill = cluster)) +
        geom_boxplot() +
        scale_y_log10() +
        labs(
          title = 'Distribution of Nightly Prices by Cluster',
          x = "Property Cluster",
          y = "Nightly Price log(USD)"
        )
Box Plot with our clusters on the x axis and logarithmically transformed nightly price along the y axis. This plot shows that cluster 3 has exceptionally low average prices and the narrowest range of prices.

Figure 4: Shows Distribution of Logged Nightly Prices by our K-Mean Clustered Groups

The plot above demonstrates the distribution of nightly prices grouped by our k-mean clusters. Albeit, the visual results are a bit dissappointing, there are some promising elements like the variety of ranges, especially for cluster 3. Cluster 3 tended to contain the most popular listings with the most reviews, fewest available nights, high number of amenitites, fewest required nights, and mostly posted by super hosts. This cluster demonstrates the narrowest range of prices as well as the lowest average prices, perhaps contributing to the popularity of the listings and making these popularity metrics useful in predicting price.

Bibliography

Chang, C., & Li, S. (2021). Study of price determinants of sharing economy-based accommodation services: Evidence from Airbnb.com. Journal of Theoretical and Applied Electronic Commerce Research, 16(4), 584–601. https://doi.org/10.3390/jtaer16040035

Wang, D., & Nicolau, J. L. (2017). Price determinants of sharing economy based accommodation rental: A study of listings from 33 cities on Airbnb.com. International Journal of Hospitality Management, 62, 120–131. https://doi.org/10.1016/j.ijhm.2016.12.007