A Machine Learning Web Application built with Flask to predict flight fares based on user-selected options like airline, city, departure time, number of stops, class, etc.
This project demonstrates:
- End-to-end integration of ML models within a Flask web app.
- Clean and user-friendly Bootstrap-based UI.
- Use of Random Forest Regressor for prediction.
(hosted on render) https://flight-price-prediction-8wup.onrender.com/
flight-price-prediction/
│
├── app.py # Main Flask App
├── fly1.csv # Dataset (Encoded CSV)
├── requirements.txt # Python dependencies
│
├── templates/
│ └── flight.html # Frontend HTML (Bootstrap + Styling)
│
└── static/
└── style.css (optional) # We have used inline CSS in flight.html
- Python
- Flask
- Pandas
- Scikit-Learn
- HTML / CSS / Bootstrap 4
Your dataset contains categorical numerical encodings:
| Column Name | Description |
|---|---|
airline |
Airline (Encoded ID) |
source_city |
Source City (Encoded ID) |
departure_time |
Departure Time (Encoded) |
stops |
Stops (Encoded) |
arrival_time |
Arrival Time (Encoded) |
destination_city |
Destination (Encoded) |
classs |
Class (1: Economy, 2: Business) |
price |
Ticket Price (Target) |
git clone https://github.com/lovnishverma/flight-price-prediction.git
cd flight-price-predictionpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtpython app.pyVisit: http://127.0.0.1:5000/
| Home Page | Prediction Result |
|---|---|
![]() |
![]() |
- Select Airline, Source, Destination, etc.
- Submit the form.
- App predicts & shows estimated fare in INR.
flask
pandas
scikit-learnLovnish Verma GitHub
This project is licensed under the MIT License — feel free to use, modify, and share.
- Render Account: Sign up at https://render.com
- Your project must be pushed to GitHub (Public or Private).
flight-price-prediction/
│
├── app.py
├── fly1.csv
├── requirements.txt
├── templates/
│ └── flight.html
├── static/
│ └── style.css (optional)
└── .render.yaml <-- Important for auto-deployment (optional)
flask
pandas
scikit-learnservices:
- type: web
name: flight-fare-app
env: python
buildCommand: ""
startCommand: python app.py
plan: freeChange:
app.run(debug=True)To:
app.run(host='0.0.0.0', port=10000)Render exposes port 10000 by default.
-
Click "New Web Service"
-
Connect to GitHub Repository
-
Fill in the details:
-
Name:
flight-fare-app(or your choice) -
Environment:
Python -
Build Command: leave empty (
requirements.txthandles it) -
Start Command:
python app.py
-
Environment Variables: Not needed here.
-
-
Click Create Web Service
-
Wait for deployment (Render will auto-install dependencies).
- Static / Templates not found: Ensure your folder names are exactly
templates/andstatic/ - File not found (CSV): Ensure
fly1.csvis committed and in the root directory.
Render will provide you a live URL like:
https://flight-fare-app.onrender.com
venv/
__pycache__/
*.pyc-
app.py -
requirements.txt -
templates/flight.html -
fly1.csv -
.render.yaml(optional but clean) -
static/style.css(optional) -
.gitignore
https://flight-fare-app.onrender.com

