01 · FORMULA FIRST
k-Nearest Neighbors
Distance is evaluated at prediction time; k controls sensitivity versus smoothness.
-- SQL appears after execution.
FORMULA → RELATION → MARIADB SQL
Every SQL operator should trace back to mathematics. We begin with the formula, shape relational state, then run on warin.me MariaDB.
FORMULA-FIRST LAB
DuckDB suits isolated analytics; this edition exposes a client-server engine and dialect while preserving mathematical meaning.
01 · FORMULA FIRST
Distance is evaluated at prediction time; k controls sensitivity versus smoothness.
-- SQL appears after execution.
02 · FORMULA FIRST
Conditional independence simplifies evidence; logs and smoothing make it numerically robust.
-- SQL appears after execution.
03 · FORMULA FIRST
Slope is expected change, not causal proof; aggregates become model coefficients.
-- SQL appears after execution.
04 · FORMULA FIRST
One round assigns and updates; production repeats until declared convergence.
-- SQL appears after execution.
05 · FORMULA FIRST
A z-score is review evidence, not an automatic fraud verdict.
-- SQL appears after execution.
COMPARE, DO NOT REPLACE
Syntax and execution plans may differ; mathematical meaning must remain invariant.