This project now includes an interactive web application built with Streamlit! You can run it locally in your browser with a beautiful, user-friendly interface.
# Install dependencies
pip install -r requirements.txt
# Launch the web application
streamlit run app.pyor
π Try the live web app here:
π https://deepak-performance-predictor.streamlit.app
Or use the launcher scripts:
- Linux/Mac:
bash run_app.sh - Windows: Double-click
run_app.bat
The app will automatically open in your browser at http://localhost:8501
- π― Interactive Prediction Interface - Real-time student performance predictions
- π Live Model Training - Train models with custom dataset sizes
- π Beautiful Visualizations - Interactive charts with Plotly
- π Prediction History - Track all predictions with timestamps
- π‘ Smart Recommendations - Personalized advice for each student
- π₯ Data Export - Download datasets and prediction history
- π¨ Modern UI - Clean, responsive design with tabs and metrics
- π Real-time Updates - Instant predictions and visualizations
This machine learning project predicts student performance based on key academic indicators using Python and scikit-learn. The system achieves 73.81% accuracy using Linear Regression.
β
Web Application with interactive UI
β
Automated dataset generation with 200+ student records
β
Data preprocessing and cleaning
β
Two ML models: Linear Regression & Decision Tree
β
80-20 train-test split
β
Comprehensive model evaluation
β
New student prediction capability
β
Beautiful visualizations and dashboards
β
Beginner-friendly code with detailed comments
β
Prediction history tracking
β
Export functionality
The model predicts Final Marks based on:
- Attendance (%) - Class attendance percentage
- Study Hours - Daily study hours (1-10 hours)
- Previous Marks - Performance in previous exams
- Assignment Scores - Assignment completion scores
- Python 3.8 or higher
- pip package manager
pip install -r requirements.txtThis will install:
- pandas, numpy - Data manipulation
- matplotlib, seaborn, plotly - Visualizations
- scikit-learn - Machine learning
- streamlit - Web application framework
streamlit run app.pyWeb App Includes:
- Interactive prediction form with sliders
- Real-time model training
- Multiple visualization tabs
- Performance metrics dashboard
- Prediction history with export
- Data analytics and insights
Run the main ML pipeline:
python student_performance_predictor.pyPredict for new students:
python predict_new_student.pystudent_performance_ml/
β
βββ app.py # π NEW: Streamlit web application
βββ run_app.sh # π NEW: Launch script (Linux/Mac)
βββ run_app.bat # π NEW: Launch script (Windows)
β
βββ student_performance_predictor.py # Main ML project script
βββ predict_new_student.py # CLI prediction tool
β
βββ student_dataset.csv # Generated dataset
βββ test_predictions.csv # Model predictions
βββ prediction_results.png # Visualization dashboard
βββ feature_importance.png # Feature importance chart
βββ model_report.txt # Detailed model report
β
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
- RΒ² Score (Accuracy): 73.81%
- Mean Absolute Error: 4.64 marks
- Root Mean Squared Error: 5.68 marks
- RΒ² Score (Accuracy): 24.77%
- Mean Absolute Error: 7.13 marks
- Root Mean Squared Error: 9.62 marks
Based on Linear Regression coefficients:
- Study Hours: 2.4803 (Most Important)
- Attendance (%): 0.3273
- Previous Marks: 0.3050
- Assignment Scores: 0.1395
| Student | Attendance | Study Hours | Previous Marks | Assignments | Predicted Marks |
|---|---|---|---|---|---|
| 1 | 95% | 8.5 hrs | 88 | 92 | 90.73 |
| 2 | 75% | 5.0 hrs | 70 | 78 | 68.06 |
| 3 | 60% | 3.0 hrs | 55 | 65 | 51.81 |
| 4 | 85% | 6.5 hrs | 80 | 85 | 79.08 |
- Interactive sliders for all student metrics
- Real-time prediction with grade display
- Gauge chart visualization
- Personalized recommendations
- Side-by-side model comparison
- Actual vs Predicted scatter plots
- Feature importance visualization
- Detailed accuracy metrics
- Dataset statistics overview
- Distribution histograms
- Correlation heatmap
- Downloadable datasets
- Complete prediction log
- Trend visualization
- Export to CSV
- Clear history option
- Study hours have the strongest impact on final marks
- The model achieves low prediction errors (~4.64 marks)
- Linear Regression outperforms Decision Tree for this dataset
- Students with 8+ study hours and 90%+ attendance score above 85
Perfect for:
- Machine Learning beginners
- Data Science students
- Academic project demonstrations
- Understanding regression models
- Learning scikit-learn basics
- Web app development with Streamlit
- Interactive data visualization
- Backend: Python 3.8+
- ML Libraries: scikit-learn, pandas, numpy
- Visualization: matplotlib, seaborn, plotly
- Web Framework: Streamlit
- Data Processing: pandas, numpy
- β Add interactive web interface (COMPLETED!)
- π User authentication and data persistence
- π Database integration (SQLite/PostgreSQL)
- π More advanced models (Random Forest, XGBoost)
- π Cross-validation and hyperparameter tuning
- π API endpoints for external integration
- π Mobile-responsive design
- π Multi-language support
- π Export reports to PDF
# Make sure all dependencies are installed
pip install -r requirements.txt
# Try running directly
streamlit run app.py# Use a different port
streamlit run app.py --server.port 8502# Reinstall requirements
pip install -r requirements.txt --upgradeFeel free to fork this project and add your own improvements!
This project is open-source and available for educational purposes.
Created as a beginner-friendly ML project with live web interface for educational demonstrations.
- Built with Streamlit
- ML models using scikit-learn
- Visualizations with Plotly
Note: Dataset is synthetically generated for demonstration purposes.
For issues or questions, please open an issue on the project repository.
Happy Learning! πππ