About the Machine Learning Models

GradeCompass demonstrates end-to-end comparative machine learning using a public educational dataset. Two complementary models were trained on identical demographic background features:

  • Linear Regression (Regression): Predicts the continuous expected average exam score across math, reading, and writing (0–100 scale).
  • Logistic Regression (Binary Classification): Predicts the probability of a student passing (defined as achieving an average score ≥ 60/100).

1. Dataset & Problem Framing

The models were trained on the public Kaggle Students Performance in Exams dataset, containing 1,000 student records with no missing values.

Crucial Design Choice: Individual exam scores (math, reading, writing) are used strictly to derive target labels and are never fed into the models as predictors. Inputs are exclusively the 5 categorical background attributes:

  • Gender: Female, Male
  • Race / Ethnicity: Groups A, B, C, D, E
  • Parental Level of Education: Some High School, High School, Some College, Associate's Degree, Bachelor's Degree, Master's Degree
  • Lunch Type: Standard, Free/Reduced (proxy for household socioeconomic background)
  • Test Preparation Course: None, Completed

2. Feature Engineering & Data Contract

The 5 categorical variables are converted into 17 binary features via one-hot encoding in a strictly ordered sequence, followed by feature standardization using scikit-learn's StandardScaler fit exclusively on an 80% training split (random_state=42).

All weights, biases, means, and standard deviations are exported to a single portable JSON file (model_params.json), allowing client-side inference directly inside the user's browser with zero runtime backend dependency.

3. Model Performance & Evaluation

Evaluation conducted on the held-out 20% test set (200 students):

Linear Regression (Average Score Prediction)

Evaluation Metric Result Interpretation
R² Score 0.1622 Demographic attributes alone account for ~16.2% of exam score variance. This modest R² is standard and honest: individual study habits, attendance, and teaching quality account for the remaining variance.
MAE (Mean Absolute Error) 10.49 points Predictions on average fall within ~10.5 points of actual exam scores.

Logistic Regression (Pass / At-Risk Classification)

Pass threshold: 60.0 / 100.

Classification Metric Result Interpretation
Accuracy 68.00% Correctly classifies 68 out of 100 students in the test set.
Precision 72.29% When the model predicts "Likely to Pass", it is correct 72.3% of the time.
Recall 86.96% The model identifies 87.0% of all students who actually passed.

Confusion Matrix (Test Set: 200 Students)

Predicted At-Risk Predicted Pass Actual Fail: 16 46 Actual Pass: 18 120

4. Team Roles & Responsibilities

  • Fasih: Data preprocessing contract, Linear Regression model training & metrics, parameter merge script, and Vercel deployment.
  • Abdul Hayy: Logistic Regression model training & metrics, browser client-side inference engine (model.js), interactive web UI (ui.js), comparative test prep bar chart (chart.js), and documentation.

5. Ethical Considerations & Algorithmic Limits

ℹ️
Correlation vs. Causation: Statistical models reflect aggregate patterns in historical data, including structural inequities such as socioeconomic disparities. They do not represent innate ability or deterministic outcomes. GradeCompass is designed as an educational tool to study how linear and logistic regression operate side by side.
← Back to Predictor