Model G20 2027 at FLAME University, registrations now open
← All student work

The OYI Review · One Young India Press

White paper Publication record

From Dots to Decisions: Linear Regression Made Easy for a 5-Year-Old

By Dwij Verma

Published 2025 · Reviewed and updated 2026 by One Young India Review

Abstract

This paper explains linear regression using a kid-friendly picture: a "smart" straight line drawn through a scatter of dots. It builds up the core idea, how a computer finds the best line by shrinking its mistakes, and how good the line is (the R² score, like a grade out of 100). But the paper then follows the title all the way to its second word, decisions. The same humble best-fit line now helps decide who gets a bank loan, a free hospital card, or a welfare benefit in India. Using a real Indian dataset (monsoon rainfall vs. the national foodgrain harvest) and a documented case of a biased scoring system, it argues that a line is only as fair as the dots it was drawn through, and ends with a concrete governance rule: any organisation that lets a fitted line judge a person should be required to check that its data represents everyone and to publish its error rates group by group.

1. Hello, What's Linear Regression?

Imagine you draw dots on paper for a group of children, each dot's position set by a child's age and height. Linear regression is the trick of drawing one straight line that passes as close as possible to all of those dots at once. That single line captures the relationship between the two things: as age goes up, height tends to go up too.

The line has a simple equation:

ŷ = β₀ + β₁x

  • x is the input (say, age).
  • ŷ ("y-hat") is the predicted output (estimated height).
  • β₀ (beta-zero) is the intercept, where the line meets the y-axis.
  • β₁ (beta-one) is the slope, how much y changes for each one-step change in x.

That is the whole idea. Everything else in this paper is just about how a computer picks the best line, how we grade it, and, most importantly, what happens when that line is used to make a real decision about a real person.

2. Why Do We Draw Lines at All?

Because a line lets us guess about situations we have not seen yet. If we have heights for children aged 3, 4, 5 and 7, the line can estimate how tall a 6-year-old is likely to be. Shops use the same move to predict sales from advertising spend; an ice-cream stall predicts sales from the day's temperature. A good line turns yesterday's dots into tomorrow's predictions, and a prediction, once someone acts on it, quietly becomes a decision.

3. How the Computer Learns to Draw

The computer tries many candidate lines. For each one, it measures the vertical gap between every dot and the line. Those gaps are called errors (or residuals). The goal is the line with the smallest total error.

The error for a single point is:

Error = y − ŷ

We square each error so that gaps above and below the line both count as positive, and big misses are punished more:

(Error)² = (y − ŷ)²

The computer then adjusts the slope and intercept until the sum of all these squared errors is as small as it can be. This method is called least-squares regression, it literally finds the line with the least squared error.

4. Is the Line a Good Line?

R-squared (R²) grades the line from 0 to 1 (or 0% to 100%). It answers: of all the up-and-down variation in the output, how much does our input actually explain?

  • R² = 0.95 means 95% of the variation in height is explained by age, a very tight fit.
  • R² = 0.20 means only 20% is explained, a loose, weak fit.

A higher R² means a better-fitting line. But hold on to one warning for later: R² is a single number for the whole crowd. A line can score a good overall R² and still be badly wrong for one group hidden inside that crowd.

5. Let's Play with More Dots (Multiple Linear Regression)

Real life rarely depends on just one thing. Height depends on age, but also on nutrition, sleep and genes. When we use several inputs at once, called features, we use multiple linear regression. With two features the "line" becomes a flat sheet (a plane); with many features it becomes a hyperplane we can no longer draw, but the maths is the same: find the surface that makes the total squared error smallest.

6. A Real Line: The Monsoon and India's Foodgrains

Textbooks usually teach this with a toy example where prices are exactly ten times size, so the line is perfect and R² is 1. Real data is messier, and far more interesting. Consider one of the most consequential straight lines in India.

About two-thirds of India's cultivated land is watered by the monsoon rather than by irrigation, and farming still supports roughly 46% of the country's workforce (Agriculture in India / Economic Survey 2025 to 26). So a natural question is: how much of the year-to-year swing in India's total foodgrain harvest is explained just by how much it rained?

When climatologists fit a single straight line from summer-monsoon rainfall to national foodgrain output, the two move together at a correlation of about 0.82, which means that one rainfall line explains roughly two-thirds of the variation in the harvest (R² ≈ 0.67), leaving the remaining third to technology, seeds, policy and luck (Parthasarathy, Munot & Kothawale, 1988). In our earlier language, the slope β₁ is positive (more rain, more grain) and the intercept β₀ is the baseline harvest you would expect in an average-rain year.

The same three lines of code that fit the toy example fit this real one, you hand a library such as scikit-learn your columns of rainfall (x) and harvest (y), call fit, and read back the slope, intercept and R²:

model = LinearRegression(); model.fit(rainfall, harvest); model.score(rainfall, harvest) → an R² near 0.67 (Pedregosa et al., 2011).

This is why the government and insurers watch the monsoon so closely: a fitted line lets them estimate the harvest months in advance, plan grain buffers, and price crop insurance. The dots are rainfall; the decision is national food policy.

7. When the Line Doesn't Work (Limitations)

A straight line only fits things that are actually straight-ish. When the true relationship curves, a line will miss badly, the fix is polynomial regression, decision trees, or other flexible models. Outliers (a few extreme dots, like one freak flood year) can tug the whole line off course. And a line built on the past assumes the future behaves like the past, a dangerous assumption when the climate itself is shifting. The golden habit: always plot the dots and look before you trust the line.

8. From Dots to Decisions: When a Line Judges a Person

Here is where the title earns its second half. The moment a fitted line is used to score a person, its little errors stop being academic and start changing lives.

Credit. When you apply for a loan in India, a statistical model scores your "creditworthiness" from features like income, past repayments and account history, and that score helps decide whether you are approved. If the model was trained mostly on borrowers from one kind of background, people it rarely saw, first-time borrowers, rural applicants, women without a credit history, can be scored as risky simply because the line was never drawn through dots like them.

Welfare. India's flagship health scheme, Ayushman Bharat (PM-JAY), decides who receives free hospital cover by scoring households against deprivation and occupational criteria drawn from the Socio-Economic Caste Census (SECC) 2011, a statistical rulebook that today covers on the order of 50 crore people (Ayushman Bharat Yojana, 2018-). When a formula this large draws the line between "eligible" and "not eligible," a household wrongly placed on the wrong side of that line can lose real protection. The dots have become decisions about health, money and dignity.

9. Fairness and Mistakes (Ethical Considerations)

Bias creeps in when the training dots do not represent everyone the line will later judge. If our height data only included tall children, the line would systematically misjudge short ones. A loan model trained on a single neighbourhood can unfairly deny borrowers from everywhere else, not out of malice, but because it is confidently extending a line into territory it never actually saw.

This is not hypothetical. In a landmark 2016 investigation, journalists at ProPublica audited COMPAS, a risk-score used in some US courts to predict whether a defendant would re-offend. Among people who did not go on to re-offend, the tool wrongly flagged 44.9% of Black defendants as high-risk, versus 23.5% of white defendants, almost double the false-alarm rate (ProPublica, 2016). Crucially, the tool's overall accuracy looked similar across groups, so a single accuracy number hid the unfairness; the gap only appeared once the errors were split by race. (The maker, Northpointe, disputed ProPublica's interpretation, arguing the score was equally calibrated, a genuine debate about what "fair" even means, and exactly the kind of argument a public audit is meant to force into the open.)

The lesson for India is direct: a credit or welfare line that looks accurate overall can still be quietly wrong for one caste, gender or region, and you will never notice if you only ever look at one overall R².

10. A Rule Worth Writing Down

General advice like "use diverse data" is true but too soft to act on. So here is a concrete rule. Any organisation that lets a fitted line decide something important about a person, a loan, a hospital card, a welfare benefit, a college seat, should be required to do two specific things:

  1. Representativeness check (before launch). Prove that the training dots actually include every kind of person the line will judge, every region, gender, caste and income band. A line drawn only through one neighbourhood's borrowers, or only through tall children, will misjudge everyone it never saw.
  2. Per-subgroup error reporting (after launch, published). Report the R² and the error rates, false approvals and false denials, separately for each group, not one flattering overall score. COMPAS passed on a single accuracy number; its 44.9%-vs-23.5% unfairness only showed up when the errors were broken out by race (ProPublica, 2016). Splitting the score by group is the single cheapest audit that would have caught it.

India's own regulator is already moving this way: the Reserve Bank of India's Working Group on Digital Lending (2021) recommended that credit-scoring algorithms be "transparent, explainable, non-discriminatory and auditable" (RBI Working Group on Digital Lending, 2021). Legal analysts reading that report have proposed the natural next step, requiring lenders to disclose the parameters their score is built on and screen them for discriminatory factors such as gender, caste and religion (Ikigai Law, 2021). Turning that principle into a hard requirement, a mandatory, published, group-by-group error report for any score that gates credit, health or welfare, is the concrete next step. It is the difference between "we hope the model is fair" and "here is the evidence, broken down by group, that it is."

11. Conclusion: What We've Learned

Linear regression is, at heart, the friendliest idea in statistics: draw the one straight line that best follows a cloud of dots. A computer "learns" that line by making its squared mistakes as small as possible, and we grade the fit with R². Adding more features gives it more predictive power. But the same simple line that estimates a child's height also estimates a farmer's harvest and, increasingly, scores a person for a loan, a hospital card or a welfare benefit. A line is only ever as fair as the dots it was drawn through, so the responsible move is not just to draw a good line, but to prove, group by group, that it treats everyone it judges fairly.

Reflection Time

"If you can't explain it to a five-year-old, you don't understand it.", a line popularly attributed to Albert Einstein (there is, in fact, no record he ever said it, a small reminder to check even our most-quoted sources).

Sources

  1. Parthasarathy, B., Munot, A. A., & Kothawale, D. R. (1988). Regression model for estimation of Indian foodgrain production from summer monsoon rainfall. Agricultural and Forest Meteorology, 42, 167 to 182. https://www.sciencedirect.com/science/article/abs/pii/0168192388900755, correlation of ~0.82 (R² ≈ 0.67) between summer-monsoon rainfall and national foodgrain production.
  2. Agriculture in India (with figures from the Economic Survey 2025 to 26). Wikipedia. https://en.wikipedia.org/wiki/Agriculture_in_India, about two-thirds of cultivated land is monsoon-dependent; agriculture supports ~46% of the workforce.
  3. Angwin, J., Larson, J., Mattu, S., & Kirchner, L. (2016). Machine Bias. ProPublica. https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing, COMPAS wrongly flagged 44.9% of non-reoffending Black defendants as high-risk vs. 23.5% of white defendants.
  4. Ayushman Bharat Yojana (PM-JAY). Wikipedia. https://en.wikipedia.org/wiki/Ayushman_Bharat_Yojana, beneficiaries identified via SECC 2011 deprivation/occupational criteria; scheme covers ~10 crore households (~50 crore people).
  5. Reserve Bank of India, Working Group on Digital Lending (2021), as summarised by Ikigai Law. https://www.ikigailaw.com/article/105/rbi-wg-report-sets-the-stage-for-regulation-of-digital-lending, recommended credit-scoring algorithms be "transparent, explainable, non-discriminatory and auditable" and screened for discriminatory parameters such as gender and caste.
  6. Pedregosa, F., et al. (2011). Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research, 12, 2825 to 2830. https://scikit-learn.org/, the LinearRegression implementation used in the examples.
  7. James, G., Witten, D., Hastie, T., & Tibshirani, R. (2013). An Introduction to Statistical Learning. Springer. https://www.statlearning.com/, accessible reference for least squares and R².

Cite this paper

Dwij Verma (2025). From Dots to Decisions: Linear Regression Made Easy for a 5-Year-Old. The OYI Review, One Young India Press. https://www.oneyoungindia.com/white-papers/from-dots-to-decisions-linear-regression-made-easy-for-a-5-year-old