← Back to projects Case Study · Personal Study Predictor · 2025

Personal Study Predictor

A least-squares regression model fitted live on your own study-hours-vs-score data - the same math behind demand forecasting, pointed at your next exam instead.

Log a handful of past study sessions and their scores, and the model tells you the trend line, how well it fits, and how many hours you'd need for a target grade.

y=mx+bLeast-squares fit
Goodness-of-fit, live
Reverse-solve: hours for target score
0server upload - runs in your browser

01 /

The Problem.

// "how much should I actually study for this?"

Students plan study time by gut feel - "I'll do 3 hours" - with no reference to how their own past effort has actually translated into scores. The relationship is rarely made explicit, so the same over- or under-preparation mistakes repeat every exam cycle.

A simple regression model, fit on a student's own history rather than a generic study guide, turns "how much should I study" into an answerable question.

02 /

Methodology.

// least squares, fit live on your data

Least-Squares Fit

slope = Σ(x−x̄)(y−ȳ) / Σ(x−x̄)². The line that minimizes total squared error between predicted and actual scores.

R² Goodness of Fit

R² = 1 − SS_res / SS_tot. How much of the score variation the study-hours trend actually explains - low R² means other factors dominate.

Forward Prediction

Given a planned number of study hours, the fitted line predicts an expected score.

Reverse Solving

hours = (target − intercept) / slope. Given a target score, back-solves for the study time the trend line implies.

03 /

What’s in the build.

// shipped features

Log past sessions

Add study-hours/score pairs from real past exams - the model refits instantly on every new point.

Live scatter + trend line

An inline SVG plot of every data point against the fitted regression line - no charting library required.

Forward prediction

Enter planned study hours, get a predicted score from your own trend.

Reverse target-solving

Enter a target score, get the study hours your own history implies you'd need.

Fit-quality warning

Flags when R² is too low to trust the prediction - teaching that not every trend line is reliable.

Sample dataset

Preloaded study-hours/score history so you can see the model work before logging your own.

04 /

Stack & Outcome.

// what it took, what it shipped

Stack

HTML5 Vanilla JavaScript (ES6) Inline SVG rendering Web Storage API No build step

Outcome

A student sees, in real numbers, whether "study more" actually predicts a better score for them specifically - and gets a concrete hours target instead of a vague intention.

Live Tool

Try it below

LIVEpersonal-study-predictor · runs entirely in your browser
Add at least 2 data points or load the sample dataset.
Enter values and calculate.