This repository contains an end-to-end flight fare prediction model built using a Random Forest algorithm. The model is deployed with Flask for creating a web application, and JavaScript is used for client-side data validation.
This project aims to predict flight fares based on various input features such as airline, date of journey, source, destination, and more. The primary technologies used are Python, Flask, and JavaScript.
- Predict flight fares using a Random Forest model.
- Web interface built with Flask for easy interaction.
- Client-side validation using JavaScript to ensure data integrity.
-
Clone the repository:
git clone https://github.com/yourusername/flight-fare-prediction.git cd flight-fare-prediction
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Start the Flask application:
python main.py
-
Open your web browser and go to
http://127.0.0.1:5000/
to use the application.
- Enter the required flight details in the web form.
- Click the "Predict Fare" button.
- The predicted fare will be displayed on the screen.
- Algorithm: Random Forest
- Libraries: scikit-learn, pandas, numpy
- Training Data: The model is trained on a dataset containing various flight details and their corresponding fares.
flight-fare-prediction/
├── static/
│ └── js/
│ └── validation.js
├── templates/
│ └── index.html
├── main.py
├─── flight_fare_model.pkl
├── requirements.txt
└── README.md
static/js/sript.js
: Contains JavaScript code for client-side data validation.templates/index.html
: HTML template for the web interface.app.py
: Main Flask application file.model/flight_fare_model.pkl
: Pre-trained Random Forest model.requirements.txt
: List of required Python packages.README.md
: Documentation file.
Contributions are welcome! Please fork this repository and submit pull requests with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.