Downloads · 30 days
0
elortahor12/airbnb_nyc
airbnb_nyc is a machine learning model from elortahor12. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This project analyzes Airbnb listings in New York City. The primary goal was to predict listing prices and classify properties into price tiers (Low, Medium, High). The project demonstrates a full Data Science lifecyc…
Downloads · 30 days
0
Access
Public
Updated Dec 11, 2025
Repo size
2.8 MB
Likes
0
Public
Click a slice to open those files.
.csv7.1 MB · 41%
From the Hugging Face model README
This project analyzes Airbnb listings in New York City. The primary goal was to predict listing prices and classify properties into price tiers (Low, Medium, High). The project demonstrates a full Data Science lifecycle: from rigorous data cleaning and EDA to training regression and classification models, identifying critical data leakage, and performing unsupervised clustering.
The notebook follows these main steps:
We started by examining the distribution of data and relationships between variables. The heatmap was particularly revealing.
Visualizations: Correlation and Distributions

Key Insight: The perfect correlation between 'price' and 'service_fee' was the first indicator that 'service_fee' is a direct derivative of the target variable, leading to data leakage.
service_fee, minimum_nights, number_of_reviews, reviews_per_month, review_rate_number, calculated_host_listings_count, availability_365, construction_year, lat, long.priceThe graphs below show the actual vs. predicted prices and the feature importance based on the setup above.

Observation: The RMSE is extremely low (~$25), and the R2 score is very high. While this looks great, it raises a suspicion of potential data leakage (overfitting to a specific feature). We will investigate this further in the Classification section.
To build a realistic model, we defined three price classes: Low, Medium, and High. We then removed the service_fee feature and retrained the models.
The Reality Check Without the leaked information, the accuracy dropped to ~33% across all models. This indicates that physical features alone (like neighbourhood or room type) are not sufficient to linearly separate price tiers in this specific dataset.
Model Comparison We compared Logistic Regression, Decision Tree, and KNN.

Confusion Matrices The matrices below illustrate the difficulty the models faced in distinguishing between the three classes without the price proxy.

Selected Model: Logistic Regression was chosen as the final model due to its stability and F1-Score compared to the others.
We applied K-Means clustering to identify inherent groups in the data based on location and property attributes.
Cluster Analysis The visualizations below show the segmentation of NYC listings.

service_fee leakage was critical for model validity.import pickle
import pandas as pd
# Load the trained model
with open("classification_model.pkl", "rb") as f:
model = pickle.load(f)