MindSpace is a comprehensive data analytics platform designed to help educators and students understand mental health patterns, burnout risks, and sentiment trends. By analyzing study habits, sleep patterns, and subjective feedback, MindSpace provides actionable insights via an intuitive web dashboard.
๐ Academic Project: MindSpace was developed as a minor project for analyzing student burnout in higher education settings using sentiment analysis and data visualization techniques.
- ๐ Features
- ๐ ๏ธ Tech Stack
- ๐ฆ Installation
- โ๏ธ Setup Guide
- โก Quick Start
- ๐ Data Requirements
- ๐ก Usage
- ๐จ UI/UX Design
- ๐ Project Structure
- ๐ฅ Team
- ๐ฎ Future Enhancements
- ๐ Research References
- ๐ค Contributing
- ๐ก๏ธ Security
- ๐ License
- ๐ง Contact
MindSpace offers a comprehensive suite of features for student burnout analysis:
-
๐ Data-Driven Insights: Automatically calculates a "Burnout Score" based on study-to-sleep ratios and stress levels using a weighted algorithm that normalizes results to a 0-100 scale.
-
๐ฌ Sentiment Analysis: Utilizes Natural Language Processing (NLTK VADER Sentiment Analyzer) to analyze text feedback and gauge student sentiment, providing compound scores ranging from -1 (very negative) to +1 (very positive).
-
โ ๏ธ Risk Classification: Categorizes students into 'Low', 'Medium', and 'High' risk tiers for proactive intervention:- ๐ข Low Risk: Burnout score โค 33
- ๐ก Medium Risk: Burnout score 34-66
- ๐ด High Risk: Burnout score > 66
-
๐ Interactive Dashboard: Visualizes data through 10 charts covering:
- Burnout score histogram, risk pie chart, stress vs burnout bar chart
- Correlation heatmap, scatter plots (sleep, study, and stress vs burnout)
- Burnout boxplot by risk tier, sentiment distribution, sentiment vs burnout
- Each chart includes a plain-English explanation of what the pattern means
-
๐ Searchable Data Table: Full dataset shown with no row limit. Live search by any column and a risk-level dropdown filter.
-
๐ค Automatic Model Evaluation: A Random Forest classifier trains on every uploaded dataset automatically. The Evaluation tab shows accuracy, precision, recall, F1, ROC-AUC, per-class breakdown, and confusion matrix. No CLI steps needed.
-
๐ Dataset Comparison: Upload a second CSV from the Compare tab to get a side-by-side breakdown including a delta table, risk tier cards, 4 comparison charts, and an auto-generated written verdict.
-
โ๏ธ Dynamic Dataset Management:
- Upload custom CSV files with real-time processing
- Edit data directly through the web interface
- Automatic recalculation of all metrics upon data changes
-
๐ Robust Error Handling:
- Division by zero protection in burnout calculations
- Automatic data type conversion for numeric fields
- Missing directory creation for visualizations
- CSV format validation
| Layer | Technology |
|---|---|
| Backend | Python, Flask |
| Data Processing | Pandas, NumPy |
| Machine Learning | scikit-learn (Random Forest) |
| NLP | NLTK (VADER Sentiment Analyzer) |
| Visualization | Matplotlib, seaborn |
| Frontend | HTML5, CSS3 (Vanilla), Jinja2 |
| Fonts | Outfit (Google Fonts) |
- Python 3.7 or higher
- pip (Python package installer)
bash
git clone <repository-url>
cd MindSpace
bash
# On Windows
python -m venv venv
venv\Scripts\activate
# On macOS/Linux
python3 -m venv venv
source venv/bin/activate
bash
pip install -r requirements.txt
This will install the following packages:
- Flask - Lightweight web framework
- pandas - Data manipulation and analysis
- numpy - Numerical computing
- nltk - Natural language processing
- matplotlib - Data visualization
- seaborn - Statistical chart styling
- scikit-learn - Machine learning (Random Forest classifier and evaluation metrics)
The application automatically downloads the VADER lexicon on first run. If you encounter issues, you can manually download it:
python
import nltk
nltk.download('vader_lexicon')
A walkthrough of getting MindSpace running end to end.
git clone <repository-url>
cd mindspace# Windows
python -m venv venv
venv\Scripts\activate
# macOS / Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtpython app.pyThen open http://127.0.0.1:5000 in your browser.
- From the Home page, click the upload area and select a
.csvfile - The app processes it immediately: burnout scores are calculated, 10 charts are generated, and a Random Forest model trains on the data
- You are redirected to the Dashboard automatically
| Tab | What it does |
|---|---|
| Dashboard | Full charts, searchable data table, key statistics |
| Evaluation | Live model metrics for the uploaded dataset |
| Compare | Upload a second CSV for a side-by-side breakdown |
| Edit | Modify any row and regenerate everything |
If you want to train or evaluate the model outside the web app:
cd scripts
python train_model.py # trains and saves to ../models/
python evaluate.py # evaluates from ../models/ and saves confusion matrix- Run the application:
python app.py-
Access the dashboard: Open your browser and navigate to
http://127.0.0.1:5000 -
Upload your data:
- Prepare a CSV file with the required columns (see Data Requirements)
- Use the web interface to upload the file
- View the generated analytics on the dashboard
-
Edit data (optional):
- Navigate to the Edit page
- Modify any values directly
- All calculations update automatically
The application expects a CSV file with the following columns:
| Column Name | Type | Description | Example Value |
|---|---|---|---|
student_id (optional) |
String | Unique student identifier | S001 |
student_name (optional) |
String | Student full name | Aanya Sharma |
sleep_hours |
Float | Average nightly sleep hours | 7.5 |
study_hours |
Float | Daily study hours | 5 |
stress_level |
Integer | Stress rating on a scale of 1-10 | 6 |
feedback |
String | Qualitative text comments | Feeling a bit overwhelmed. |
csv
sleep_hours,study_hours,stress_level,feedback
8,4,7,"I feel overwhelmed with assignments"
6,6,9,"Too much pressure, can't sleep"
9,3,4,"Managing okay, but tired"
7,5,8,"Burning out, need help"
10,2,3,"Feeling good, balanced"
5,7,10,"Exhausted, high stress"
The repository includes sample datasets for testing:
data/sample_data.csv- Example dataset with 6 recordsdata/test_data.csv- Additional test data with diverse scenarios
- Landing Page: Start at the index page where you can upload a CSV file
- Data Upload: Select and upload your CSV file containing student data
- Dashboard: View the analytics dashboard with:
- Burnout score distribution histogram
- Risk category pie chart
- Summary statistics (average burnout, high-risk count)
- Individual student records with calculated metrics
- Edit Data: Make changes to existing records and see real-time updates
The burnout score is calculated using the formula:
Burnout Score = (study_hours / sleep_hours) * stress_level * 10
- Clamped to a range of 0-100
- Higher scores indicate greater burnout risk
- Division by zero is handled gracefully (defaults to 0)
| Risk Level | Score Range | Action Recommended |
|---|---|---|
| ๐ข Low | 0-33 | Monitor periodically |
| ๐ก Medium | 34-66 | Consider intervention |
| ๐ด High | 67-100 | Immediate attention required |
The application uses VADER (Valence Aware Dictionary and sEntiment Reasoner) for sentiment analysis:
- Compound Score: -1 (most negative) to +1 (most positive)
- Positive: Compound score โฅ 0.05
- Negative: Compound score โค -0.05
- Neutral: Compound score between -0.05 and 0.05
MindSpace features a modern, professional design:
- Typography: Inter font family for clean, readable text
- Color Scheme:
- Primary: Blue gradient (#1e3a8a โ #3b82f6)
- Background: White with subtle transparency
- Cards: White with soft shadows
- Responsive Design: Works on desktop, tablet, and mobile devices
- Interactive Elements: Hover effects, smooth transitions
- Data Visualization: Clean charts with proper labeling
- Statistics Cards: Display key metrics (Average Burnout, Total Students, High Risk Count)
- Data Table: Sortable, scrollable table with all student records
- Charts: Histogram for score distribution, Pie chart for risk categories
- Navigation: Easy access to edit functionality
mindspace/
โโโ app.py # Flask routes, data processing, auto-training
โโโ requirements.txt # Project dependencies
โโโ README.md # Project documentation
โโโ LICENSE # Apache License 2.0
โโโ SECURITY.md # Security policy
โโโ CODE_OF_CONDUCT.md # Community standards
โโโ CONTRIBUTING.md # Contribution guidelines
โโโ Code-Explanation.md # Detailed code documentation
โโโ scripts/ # Standalone ML scripts
โ โโโ train_model.py # Manual training script
โ โโโ evaluate.py # Manual evaluation script
โโโ models/ # Saved model artifacts (auto-generated)
โ โโโ model.pkl
โ โโโ eval_data.pkl
โโโ data/ # Dataset files
โ โโโ sample_data.csv # Sample dataset
โ โโโ updated_sample.csv # Written after edits via web interface
โโโ documents/ # Project documentation
โ โโโ synopsis.md
โ โโโ Workload-Distribution.md
โ โโโ Research-Paper/
โโโ templates/ # HTML templates (all extend base.html)
โ โโโ base.html # Shared sidebar layout and theme toggle
โ โโโ index.html # Upload page
โ โโโ dashboard.html # Analytics dashboard with 10 charts
โ โโโ evaluation.html # Model metrics page
โ โโโ compare.html # Dataset comparison page
โ โโโ edit.html # Data editor
โโโ static/ # Static assets
โโโ styles.css # Dark/light theme, all component styles
โโโ plots/ # Auto-generated chart images
โโโ score_hist.png
โโโ risk_pie.png
โโโ correlation_heatmap.png
โโโ confusion_matrix.png
โโโ cmp_burnout_hist.png # Comparison charts (cmp_*.png)
โโโ ... # (10 dashboard + 5 comparison charts total)
This project was developed by a team of 6 members:
| Role | Responsibilities |
|---|---|
| Backend Developer | Flask routes, data processing, error handling |
| Frontend Templates Specialist | HTML templates, Jinja2 integration |
| Styling & UI/UX Designer | CSS styling, responsive design |
| Data & Testing Specialist | Test data creation, end-to-end testing |
| Deployment & Integration Lead | Dependencies, integration, deployment |
| Documentation & QA | Documentation, code reviews, quality assurance |
We have exciting plans for MindSpace's future:
- User Authentication: Add login functionality for personalized dashboards
- Export Options: Export analyzed data to PDF/Excel reports
- API Development: RESTful API for programmatic access
- Real-time Analytics: Live data streaming and processing
- Enhanced Visualizations: Interactive charts with drill-down capabilities
- Database Integration: Support for SQL databases (PostgreSQL, MySQL)
- Multi-language Support: Localization for international users
- Mobile Responsive Design: Improved mobile experience
- Email Notifications: Automated alerts for high-risk students
- LMS Integration: Connect with learning management systems
- Advanced NLP: More nuanced sentiment analysis models
- Machine Learning: Predictive burnout modeling (Random Forest, auto-trains on every upload)
- Dataset Comparison: Side-by-side analysis of two cohorts
- Model Evaluation Dashboard: Live accuracy, F1, confusion matrix in the web UI
The MindSpace project is grounded in established research:
-
Maslach, C., & Leiter, M. P. (2016). Understanding the burnout experience: recent research and its implications for psychiatry. World Psychiatry, 15(2), 103-111.
-
Hutto, C. J., & Gilbert, E. E. (2014). VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text. Proceedings of the Eighth International Conference on Weblogs and Social Media (ICWSM-14).
-
Grinberg, M. (2018). Flask Web Development: Developing Web Applications with Python. O'Reilly Media.
-
McKinney, W. (2017). Python for Data Analysis. O'Reilly Media.
-
Bird, S., Klein, E., & Loper, E. (2009). Natural Language Processing with Python. O'Reilly Media.
Contributions are welcome! Please read our Contributing Guidelines for details on:
- Reporting bugs and suggesting features
- Development workflow
- Coding style guidelines
- Testing procedures
For information on how to report security vulnerabilities, please see our Security Policy.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
For questions, suggestions, or collaborations, please reach out:
- Project Lead: @eOzkull/council
- Email: inkeskdozing@gmail.com
- GitHub Issues: issues
Made with โค๏ธ for student well-being
๐ง MindSpace - Understanding Student Burnout
Metrics are computed automatically on each uploaded dataset. The values below reflect a run on the included sample_data.csv.
| Metric | Score |
|---|---|
| Accuracy | ~95% |
| Precision | ~96% |
| Recall | ~95% |
| F1 Score | ~95% |
| ROC-AUC | computed per dataset |
Why these metrics? F1-Score is the primary metric because class sizes can be uneven across datasets. Precision and Recall are both shown so you can see whether the model errs toward false alarms or missed cases. ROC-AUC reflects how well the model distinguishes between all three risk classes together.
The full per-class breakdown and confusion matrix are visible live in the app under the Evaluation tab after any upload.
