model.fit(X, y) is one line, and that is the problem. scikit-learn is excellent, but reaching for it before you understand what it does leaves you able to call models without being able to reason about them. Build a few core pieces by hand first, and the rest of machine learning becomes readable.

1. Linear regression

Start here because everything else generalizes from it. A linear model is just prediction = weights . features + bias. Building it teaches you what a model parameter is and what "fitting" means: finding the weights that make predictions close to the truth.

def predict(x, w, b):

return sum(wi * xi for wi, xi in zip(w, x)) + b