Predict whether a person earns > 50K or ≤ 50K using a machine-learning model trained on the Adult Census Income Dataset (UCI).
This project includes a fully functional Flask web application with a clean UI for interacting with the prediction model.
- 🚀 Flask Web App with clean UI
- 🤖 Machine Learning Model (
model.pkl) - 🧠 Feature engineering with One-Hot Encoding + Education Mapping
- 📊 Handles both categorical & numerical inputs
- ✔ Automatic feature alignment with trained model
- 🌍 Ready for deployment (Heroku / Render / PythonAnywhere / AWS)
| Home Page | Prediction Result |
|---|---|
![]() |
![]() |
│── app.py │── model.pkl │── templates/ │ └── index.html │── static/ │ └── style.css │── README.md
- Age
- Workclass
- Education
- Marital Status
- Occupation
- Relationship
- Sex
- Capital Gain
- Capital Loss
- Hours per Week
- Country
Education values are converted into numerical levels before prediction, e.g.:
Preschool → 1 Doctorate → 16
Workclass Occupation Marital_status Relationship
Ensures clean matching with the model’s training columns:
The ML model was trained using:
Pandas & Scikit-Learn
One-hot encoding for categorical features
Numerical encoding for education
Feature alignment with column consistency
Exported using pickle (model.pkl)
Python
Flask
Pandas
Scikit-Learn
HTML / CSS
Feel free to fork this repository and submit improvements or suggestions!
If you find this project useful, please star the repository ⭐

