This is a Flask-based web application that predicts student exam performance based on input parameters such as gender, parental education, lunch type, test preparation course, and scores in reading and writing. The model uses machine learning techniques to provide accurate predictions.
|-- app.py # Main Flask application
|-- templates/
| |-- index.html # Landing page
| |-- home.html # Prediction input page
|-- static/
|-- artifacts/
| |-- model.pkl # Trained machine learning model
|-- src/
| |-- exception.py # Custom exception handling
| |-- logger.py # Logging configuration
| |-- utils.py # Utility functions
| |-- components/
| |-- data_ingestion.py # Data loading and preprocessing
| |-- data_transformation.py # Feature transformation pipeline
| |-- model_trainer.py # Model training and evaluation
|-- requirements.txt # Required dependencies
|-- README.md # Project documentation
Ensure you have Python 3.8+ installed.
git clone https://github.com/yourusername/your-repo.git
cd your-repo
python -m venv venv
source venv/bin/activate # For macOS/Linux
venv\Scripts\activate # For Windows
pip install -r requirements.txt
python app.py
Open a browser and navigate to:
http://127.0.0.1:5000/
- Navigate to the Home page.
- Enter student details in the form.
- Click Predict to see the predicted Math score.
- The machine learning model is trained using RandomForestRegressor and other regression models.
- Hyperparameter tuning is performed using GridSearchCV.
- The best model is saved in
artifacts/model.pkl
.
Method | Endpoint | Description |
---|---|---|
GET | / |
Home Page |
GET | /predict |
Prediction Form |
POST | /predict |
Returns predicted math score |
Feel free to fork this repository, make changes, and submit a pull request!
- Python 3.8+
- Flask (Backend)
- Scikit-learn (Machine Learning)
- Pandas & NumPy (Data Processing)
- HTML, CSS (Frontend)
This project is licensed under the MIT License.