Lesson 0002

Skillful means

Last time: every model is a finger, never the moon. This time — there's more than one kind of finger, and choosing among them is itself a discipline.

The method must fit the situation

In the Lotus Sūtra, the Buddha is described teaching the same truth through many different methods — parables, similes, gradual instruction — chosen not arbitrarily but because each audience, each moment, called for a different vehicle to the same understanding. This is upāya: skillful means. The teaching that awakens one student can leave another untouched, not because the truth changed, but because the method wasn't matched to the situation.

The idea in one line
There is no single correct method independent of what you're trying to reach. The right means is relative to the aim — chosen after the aim is clear, never before.

STOR 323 makes the identical move, in its own vocabulary: "output space first, model family second." Before reaching for linear regression, softmax regression, or k-nearest-neighbors, you have to know what shape a correct answer even takes. Reach for the wrong vehicle — treat an unordered category as if it were a number on a scale — and you get nonsense, the same way a parable told to the wrong audience lands as noise instead of insight.

Two ways of holding what you've learned

Recall samskara from the last lesson — experience compressed into a lasting impression. That compression is one way of holding what's been learned. It isn't the only way.

👣
Direct memory — anubhava
Nothing is distilled away. Every particular encounter is kept, and understanding a new situation means going back and consulting the actual prior instances directly. k-nearest-neighbors works this way — its "model" is the stored data.

Neither is superior in the abstract — this is the same upāya logic as before. A teaching compressed into principle travels light and generalizes; direct memory of particulars stays faithful to nuance a principle might smooth over. STOR 323 calls this split parametric vs. nonparametric. You now already know it by two other names.

Softmax: nothing means anything alone

When STOR 323 needs to choose among several unordered categories — which digit, which condition — it uses softmax regression. Each category gets a raw score, and softmax converts the scores into probabilities. The mechanism is worth sitting with:

Primary source — Saṃyutta Nikāya
"If this exists, that exists. If this ceases to exist, that also ceases to exist." Pratītyasamutpāda — dependent origination: nothing in this teaching has independent, self-standing existence. Everything arises only in relation to everything else. Pratītyasamutpāda — Encyclopedia of Buddhism

A raw softmax score means nothing by itself — "3.4" isn't a probability, isn't even meaningfully large or small until it's placed against the other scores. Softmax's normalization (dividing by the sum of all the exponentials) is a mechanical enactment of that same insight: every category's probability is defined only in relation to every other category's. Push one score up, and every other probability shifts — not because anything about them changed, but because their meaning was never independent to begin with.

Sit with this
Drag one slider up and watch the others fall, even though you never touched them. Is this different in kind from the way raising one belief's confidence necessarily lowers your confidence in its alternatives — or is it the same structure, just made numerically explicit?

kNN: you are read through your company

k-nearest-neighbors makes no claim about a general rule at all. Asked to classify a new point, it looks at the K nearest existing points and takes a vote. Its entire method is: judge this by what surrounds it.

The concept — satsaṅga
Sat (truth, being) + saṅga (association) — "the company of the wise." The tradition holds that character and understanding are shaped, often decisively, by the company one keeps: proximity to the wise draws a person toward wisdom, proximity to confusion draws a person toward confusion. Satsang — The Power of Spiritual Association

kNN doesn't ask "what is the general rule for this category of thing?" It asks "who is nearby, and what are they?" — the same wager satsaṅga makes about people: that you are legible through your neighbors, not despite them. Try it below.

Sit with this
When you widen K, you're asking more neighbors for their opinion before deciding. Is that wisdom (a broader counsel) or dilution (drowning a clear signal in average opinion) — and does the answer depend on how trustworthy the nearest few actually were?

All three, side by side

Model familyHow it holds what it learnedIts upāya
Linear regressionjñāna — a few coefficientsThe answer is one number on a continuous scale
Softmax regressionjñāna — one coefficient set per categoryThe answer is one of several unordered, mutually-defining categories
k-nearest-neighborsanubhava — the data itself, kept wholeThe answer is best read through immediate company

Check what's actually landed

Answer from memory before checking.

What's the term for compressing experience into a small, portable teaching — the STOR 323 term is "parametric"?
What's the Buddhist name for "nothing has meaning independent of everything else" — the idea behind softmax's normalization?
What mechanism does kNN use among its K nearest neighbors to decide?

Go deeper

Formal side: An Introduction to Statistical Learning, Ch. 4, on multi-class classification and kNN. Philosophical side: the Lotus Sūtra's parable of the burning house is the classic upāya text if you want the fuller story behind "skillful means"; the dependent origination and satsaṅga links above are worth reading in full. See RESOURCES.md.

Same standard as last time: if the satsaṅga or dependent-origination parallel felt stretched rather than exact, push back — that's more useful to me than politeness. Next lesson: the Gita's teaching on action and its fruits, applied to choosing a threshold.