An end-to-end machine learning project that predicts student math scores based on various demographic and academic factors. This project implements a complete ML pipeline with a modern web interface for real-time predictions.
- AI-Powered Predictions: Uses advanced machine learning algorithms (XGBoost, Random Forest, etc.)
- High Accuracy: Trained on comprehensive student data with multiple evaluation metrics
- Easy-to-Use Interface: Modern, responsive web application with intuitive design
- Complete ML Pipeline: Data ingestion, transformation, and model training components
- Advanced Hyperparameter Tuning: GridSearchCV and RandomizedSearchCV for optimal performance
Access the application at: http://127.0.0.1:5000
- Home Page: http://127.0.0.1:5000/ - Landing page with project overview
- Prediction Page: http://127.0.0.1:5000/predictdata - Interactive prediction form
0721.1.mp4
mlproject/
βββ application.py # Flask web application
βββ train_model.py # Complete training pipeline
βββ requirements.txt # Project dependencies
βββ setup.py # Package configuration
βββ artifacts/ # Model artifacts
β βββ model.pkl # Trained ML model
β βββ preprocessor.pkl # Data preprocessing pipeline
β βββ train.csv # Training dataset
β βββ test.csv # Test dataset
βββ src/ # Source code
β βββ components/ # ML pipeline components
β β βββ data_ingestion.py
β β βββ data_transformation.py
β β βββ model_trainer.py
β βββ pipeline/ # Prediction pipeline
β β βββ predict_pipeline.py
β βββ exception.py # Custom exception handling
β βββ logger.py # Logging configuration
β βββ utils.py # Utility functions
βββ templates/ # HTML templates
β βββ index.html # Home page
β βββ home.html # Prediction form
βββ logs/ # Application logs
- Python 3.7+
- pip package manager
git clone https://github.com/Dulakshi-2002/mlproject.git
cd mlproject# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activatepip install -r requirements.txtpython train_model.pypython app.pyOpen your web browser and navigate to:
- Home Page: http://127.0.0.1:5000/
- Prediction Interface: http://127.0.0.1:5000/predictdata
- Random Forest
- Decision Tree
- Gradient Boosting
- Linear Regression
- XGBoost
- CatBoost
- AdaBoost
- Gender: Student's gender
- Race/Ethnicity: Student's ethnic background
- Parental Level of Education: Educational background of parents
- Lunch: Type of lunch (standard/free or reduced)
- Test Preparation Course: Completion status of test prep course
- Reading Score: Score in reading assessment
- Writing Score: Score in writing assessment
- Math Score Prediction: Predicted mathematics score (0-100)
- Navigate to Home Page: Visit http://127.0.0.1:5000/
- Click "Start Prediction": Access the prediction form
- Fill Student Information:
- Select demographic information
- Enter reading and writing scores
- Get Prediction: Click submit to receive math score prediction
The application also supports direct POST requests to /predictdata with form data.
The model uses advanced hyperparameter tuning with:
- GridSearchCV for exhaustive parameter search
- RandomizedSearchCV for efficient optimization
- Cross-validation for robust performance evaluation
- RΒ² Score as primary evaluation metric
- FLASK_ENV: Set to
developmentfor debug mode - FLASK_APP: Set to
application.py
- Models are saved in
artifacts/directory - Preprocessor pipeline includes feature scaling and encoding
- Automatic model selection based on performance metrics
-
Module Import Errors
# Ensure you're in the project root directory cd mlproject # Activate virtual environment venv\Scripts\activate
-
Missing Model Files
# Retrain the model python train_model.py -
Port Already in Use
# The app runs on port 5000 by default # Check if another service is using the port
- Add more ML algorithms
- Implement model versioning
- Add batch prediction capability
- Create REST API endpoints
- Add model explanation features
- Implement user authentication
- Add prediction confidence intervals
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Dulakshi-2002
- GitHub: @Dulakshi-2002
- Dataset source: Student Performance Dataset
- Libraries: scikit-learn, Flask, Bootstrap, XGBoost, CatBoost
- Icons: FontAwesome
β Star this repository if you found it helpful!