Skip to content

Dulakshi-2002/-Student_Performance_Predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Student Performance Predictor

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.

🌟 Features

  • 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

πŸš€ Live Demo

Access the application at: http://127.0.0.1:5000

0721.1.mp4

πŸ“ Project Structure

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

πŸ› οΈ Installation & Setup

Prerequisites

  • Python 3.7+
  • pip package manager

1. Clone the Repository

git clone https://github.com/Dulakshi-2002/mlproject.git
cd mlproject

2. Create Virtual Environment

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Train the Model (if needed)

python train_model.py

5. Run the Application

python app.py

6. Access the Application

Open your web browser and navigate to:

πŸ“Š Model Information

Algorithms Used

  • Random Forest
  • Decision Tree
  • Gradient Boosting
  • Linear Regression
  • XGBoost
  • CatBoost
  • AdaBoost

Input Features

  • 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

Output

  • Math Score Prediction: Predicted mathematics score (0-100)

🎯 How to Use

Web Interface

  1. Navigate to Home Page: Visit http://127.0.0.1:5000/
  2. Click "Start Prediction": Access the prediction form
  3. Fill Student Information:
    • Select demographic information
    • Enter reading and writing scores
  4. Get Prediction: Click submit to receive math score prediction

API Usage

The application also supports direct POST requests to /predictdata with form data.

πŸ§ͺ Model Performance

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

πŸ”§ Configuration

Environment Variables

  • FLASK_ENV: Set to development for debug mode
  • FLASK_APP: Set to application.py

Model Artifacts

  • Models are saved in artifacts/ directory
  • Preprocessor pipeline includes feature scaling and encoding
  • Automatic model selection based on performance metrics

🚨 Troubleshooting

Common Issues

  1. Module Import Errors

    # Ensure you're in the project root directory
    cd mlproject
    # Activate virtual environment
    venv\Scripts\activate
  2. Missing Model Files

    # Retrain the model
    python train_model.py
  3. Port Already in Use

    # The app runs on port 5000 by default
    # Check if another service is using the port

πŸ“ˆ Future Enhancements

  • 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

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘€ Author

Dulakshi-2002

πŸ™ Acknowledgments

  • Dataset source: Student Performance Dataset
  • Libraries: scikit-learn, Flask, Bootstrap, XGBoost, CatBoost
  • Icons: FontAwesome

⭐ Star this repository if you found it helpful!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages