cymcginnis/Student_Persistence_Dashboard
title: Student Success Risk Dashboard emoji: ๐ colorFrom: blue colorTo: teal sdk: gradio sdkversion: 4.31.0 appfile: app.py pinned: false ---
Student Success Risk Dashboard
A demo Gradio app for university staff, built on the Open University Learning Analytics Dataset (OULAD). It flags students whose early-course engagement and assessment patterns resemble past students who ended up Withdrawn or Failed, and explains why each individual student was flagged using SHAP.
Setup
- Download the OULAD CSV files and place them in a
data/folder next toapp.py: studentInfo.csvstudentRegistration.csvstudentVle.csvvle.csvassessments.csvstudentAssessment.csv- Install dependencies:
pip install -r requirements.txt - Run locally:
python app.py, or deploy as-is to a Hugging Face Space.
What it does
- Cohort Overview โ filter by module/presentation, see the top 25 highest-risk students, a historical-outcome bar chart, a risk-level donut chart, and an engagement-vs-risk scatter plot, with a plain-language summary for staff.
- Student Lookup โ look up one student by ID and see a risk gauge plus a SHAP-based breakdown of exactly which factors (low engagement, missed early assessments, late registration, etc.) are pushing their risk score up or down.
- Ask About the Data โ a chat tab (powered by OpenAI) where staff can ask plain-English questions about the dataset, the model, or the currently selected cohort. It's grounded only in cohort-level summary statistics โ never individual student rows โ and will redirect questions about a named student to the Student Lookup tab instead of guessing.
To enable the chat tab, add an OPENAI_API_KEY secret to your Space (Settings โ Repository secrets). Without it, the tab still loads but explains what's missing instead of erroring. Note that each question and a summary of the current cohort are sent to OpenAI's API to generate a response โ worth knowing if your data-handling policies require disclosure. The model used defaults to gpt-4o-mini; override it by setting an OPENAI_MODEL secret/variable if you'd rather use a different OpenAI model.
Design
The dashboard opens with a plain-language explainer contrasting a simple statistical rule ("students who miss the first quiz fail 40% of the time") with what this tool actually does (a Random Forest weighing dozens of signals in combination) โ aimed at non-technical academic staff, not data scientists. Typography uses Fraunces (headings) and Inter (body) for readability at a larger base font size than Gradio's default.
Model
A RandomForestClassifier trained on registration, VLE (virtual learning environment) clickstream, and early-assessment features from only the first 30 days of each course presentation (configurable via EARLY_WINDOW_DAYS). The model is trained once at startup and cached for the life of the process โ it does not retrain on every UI interaction.
Notes / limitations
- Predictions describe statistical resemblance to historical patterns, not certainty about any individual student. This is intended to support early advising and outreach, not automatic or punitive decisions.
- Module codes (AAA, BBB, ...) are OULAD placeholders, not real course names.
- SHAP explanations are computed per-lookup via
TreeExplainer, which is fast for a single row but the whole pipeline is retrained only at startup. Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
