Hotel Price Prediction System Using Machine Learning

Hotel Price Prediction System Using Machine Learning

Hotel Price Prediction System Using Machine Learning

The Hotel Price Prediction System is a medium-level machine learning project designed to estimate hotel room prices in major cities of Saudi Arabia. The application works with hotel listing data represented in Saudi Riyal (SAR) and uses practical room and customer-related factors to generate a model-based nightly price estimate. Instead of relying on a single property attribute, the system considers the number of beds, average customer rating, total number of ratings, and room size.

The project combines data preparation, regression modeling, validation, interactive visualization, and model explainability in one Streamlit application. This makes it suitable for a college project because students can understand the complete workflow from structured data to a usable prediction interface. The original project concept is based on consolidated Booking.com listing data and includes supporting notebooks and analysis utilities.

Complete Advance AI Topics: Click Here
Real Time Projects on YouTube:- DecodeIT

Project Overview

FieldDetails
Project NameBooking.com Hotel Price Prediction in KSA
LanguagePython
Recommended VersionPython 3.8+
Application TypeWeb Application using Streamlit
Machine LearningRegression with Random Forest
CurrencySaudi Riyal (SAR)

Why This Project Is Useful

Hotel pricing can change according to several measurable characteristics. A prediction model can provide a consistent benchmark that helps users understand the relationship between room attributes, customer feedback, and observed prices. For travelers, the predicted value can support preliminary budget planning. For analysts and tourism stakeholders, the same type of model can help examine pricing patterns, identify unusual observations, and study differences between locations. The project should be treated as an analytical benchmark rather than a guaranteed market price.

Data Description

The source dataset is organized as a CSV file named reg22.csv. Important fields include hotel name, location, room type, price, stay basis, beds, rating, rating title, number of ratings, room size, and derived log variables. The application primarily uses the numerical predictors needed for regression: beds, rating, number_of_ratings, and Size. The target is the hotel price in SAR.

Before modeling, numerical values are converted into usable numeric types, invalid observations are removed, and missing values are handled through preprocessing. This keeps the model focused on records that contain the required information.

Key Features

  • Professional Streamlit dashboard designed around a hospitality theme.
  • Interactive hotel price prediction in Saudi Riyal.
  • Random Forest regression model for nonlinear relationships.
  • RobustScaler and StandardScaler preprocessing stages.
  • Log transformation of the target to stabilize price modeling.
  • Dataset explorer with location and price filtering when those fields are available.
  • Model validation using a train/test split and five-fold cross-validation.
  • SHAP-based global explainability for understanding feature contribution.
  • Dataset-driven statistics, charts, and recent records.

Project Modules

1. Dashboard

The dashboard provides an overview of valid listings, average price, test-set R², and cross-validation performance. It also presents a price distribution chart and a location-based average price view when the dataset contains a location field.

2. Price Prediction

The prediction page provides four practical inputs: number of beds, customer rating, number of ratings, and room size. After submission, the trained model estimates the expected room price and displays the result in SAR per night.

3. Market Explorer

This section allows users to inspect the underlying CSV records. When location and price columns are available, users can filter the records by city and price range. This provides a simple way to explore the dataset used by the application.

4. Model Explainability

The SHAP module provides a global summary of how the model responds to its input features. A feature-importance table is also generated from mean absolute SHAP values, helping students and analysts understand which variables contribute most strongly to model output.

How the System Works

The workflow begins with the hotel CSV dataset. The application identifies the required columns, converts numerical fields, removes unusable observations, and prepares the predictors. The hotel price target is transformed using a logarithmic scale. The prepared data is divided into training and testing portions, after which a Random Forest Regressor is trained. Five-fold cross-validation is also used to examine model performance across multiple data splits.

During prediction, the user’s four inputs pass through the same preprocessing pipeline used during training. The model returns a transformed price estimate, which is converted back into SAR for display. This keeps the prediction workflow connected to the training process instead of using a separate calculation.

Download complete source code

Screenshot

Hotel Price Prediction System Using Machine Learning

Project Workflow

The application follows a connected college-project workflow: the dataset is loaded first, required fields are identified, invalid records are removed, numerical predictors are prepared, and the regression pipeline is trained. The dashboard then exposes the trained model through separate pages for overview, prediction, dataset exploration, and explanation. This structure keeps data preparation, model evaluation, and user interaction connected within one practical application.

Installation and Setup

Download or extract the project and open its folder in Visual Studio Code. Install Python 3.8 or newer, create a virtual environment, and install the dependencies from requirements.txt.

python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt

Place the project dataset at data/reg22.csv. Then start the Streamlit application:

streamlit run app.py

The application will open in the browser. If the CSV is missing or required columns cannot be found, the dashboard displays a clear message instead of silently producing invalid predictions.

Technologies Used

The project uses Python as the main programming language and Streamlit for the web interface. Pandas and NumPy support data processing, Matplotlib supports visual analysis, and scikit-learn provides preprocessing, Random Forest regression, train/test evaluation, and cross-validation. SciPy supports scientific processing, while SHAP provides model explainability. Seaborn and Plotly are included in the project environment for further analysis and visualization work.

Frequently Asked Questions

What is the purpose of this project?

It estimates hotel room prices in SAR using selected hotel and customer-related numerical factors.

Which machine learning algorithm is used?

The main regression model is a Random Forest Regressor, selected because it can model nonlinear relationships among the project features.

Which inputs are required for prediction?

The interactive prediction page uses beds, average rating, number of ratings, and room size.

Does the application use a database?

No separate relational database is required. The supplied project uses a structured CSV dataset as its primary data source.

What does SHAP do in this project?

SHAP helps explain the contribution of model input features, making the regression results easier to inspect and discuss.

Can the reported model accuracy be guaranteed?

No. Model performance depends on the actual dataset supplied, preprocessing, train/test split, and validation procedure. The application recalculates its metrics from the available dataset.

Future Scope

  • Expand the dataset with additional cities and more current hotel observations.
  • Add richer temporal analysis to study seasonal price changes.
  • Introduce more validated hotel attributes when reliable data is available.
  • Add downloadable analytical reports for selected locations and price ranges.
  • Compare additional regression algorithms using the same validation methodology.
  • Improve deployment and monitoring for a continuously updated dataset.

Conclusion

The Hotel Price Prediction System demonstrates how machine learning can convert structured hotel listing information into an interactive pricing benchmark. Its combination of data preprocessing, Random Forest regression, validation, Streamlit visualization, filtering, and SHAP explainability makes it more complete than a basic prediction script while remaining understandable for a college-level implementation. The project can be used to study the complete machine learning lifecycle and to explore how room and customer-related characteristics relate to hotel pricing in the Saudi Arabian market.

Hotel Price Prediction

Hotel Price Prediction

hotel leela share price prediction

itc hotel share price prediction

hotel forest inn share price prediction

indian hotels share price prediction

hotel price prediction

hotel price prediction model

hotel price prediction kaggle

hotel price prediction dataset

hotel price prediction machine learning
Hotel Price Prediction System Using Machine Learning

Leave a Reply

Your email address will not be published. Required fields are marked *