Giter Club home page Giter Club logo

ml_template's Introduction

Hotel Booking Prediction

Language and Libraries

python pandas numpy Seaborn

Problem statement.

Will the guest going to cancel hotel reservation?

  • Booking cancellations have a substantial impact in demand management decisions in the hospitality industry.

  • Cancellations limit the production of accurate forecasts, a critical tool in terms of revenue management performance.

  • To circumvent the problems caused by booking cancellations, hotels implement rigid cancellation policies and overbooking strategies, which can also have a negative influence on revenue and reputation.

  • Using data sets from four resort hotels and addressing booking cancellation prediction as a classification problem in the scope of data science

  • Results allow hotel managers to accurately predict net demand and build better forecasts, improve cancellation policies, define better overbooking tactics thus improve on inventory allocations.

How to run?

Before we run the project, make sure that you are having MongoDB in your local system, with Compass since we are using MongoDB for data storage. You also need AWS account to access the service like S3, ECR and EC2 instances.

Data Collections

image

Project Archietecture

image

Deployment Archietecture

image

Step 1: Clone the repository

git clone my repository 

Step 2- Create a conda environment after opening the repository

conda create -p env python=3.8 -y
conda activate env

Step 3 - Install the requirements

pip install -r requirements.txt

Step 4 - Export the environment variable

export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>

export AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>

export AWS_DEFAULT_REGION=<AWS_DEFAULT_REGION>

export MONGODB_URL="mongodb+srv://<username>:<password>@ineuron-ai-projects.7eh1w4s.mongodb.net/?retryWrites=true&w=majority"

Before runnig server application make sure your s3 bucket is available and empty

### Step 5 - Run the application server
```bash
python app.py

Step 6. Train application

http://localhost:8080/train

Step 7. Prediction application

http://localhost:8080

Run locally

  1. Check if the Dockerfile is available in the project directory

  2. Build the Docker image

docker build --build-arg AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID> --build-arg AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY> --build-arg AWS_DEFAULT_REGION=<AWS_DEFAULT_REGION> --build-arg MONGODB_URL=<MONGODB_URL> . 

  1. Run the Docker image
docker run -d -p 8080:8080 <IMAGEID>

๐Ÿ‘จโ€๐Ÿ’ป Tech Stack Used

  1. Python
  2. FastAPI
  3. Machine learning algorithms
  4. Docker
  5. MongoDB

๐ŸŒ Infrastructure Required.

  1. AWS S3
  2. AWS EC2
  3. AWS ECR
  4. Git Actions
  5. Terraform

Models Used

  • Logistic Regression
  • KNeighbors Classifier
  • XGB Classifier
  • CatBoost Classifier
  • RandomForest Classifier

From these above models after hyperparameter optimization we selected Top two models which were XGBRegressor and Random Forest Regressors and used the following in Pipeline.

  • GridSearchCV is used for Hyperparameter Optimization in the pipeline.

  • Any modification has to be done in Inside Config.yaml which can be done in route /update_model_config

hotel is the main package folder which contains

Artifact : Stores all artifacts created from running the application

Components : Contains all components of Machine Learning Project

  • DataIngestion
  • DataValidation
  • DataTransformations
  • ModelTrainer
  • ModelEvaluation
  • ModelPusher

Custom Logger and Exceptions are used in the Project for better debugging purposes.

Conclusion

  • It helps to save the resources and also helps to gain more profit from the business based on the study.

=====================================================================

ml_template's People

Contributors

akash1118 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.