The four-piece contract
Machine learning is not a magic box that turns data into answers. It is a contract among four pieces: a target you want to predict, the features you are allowed to use at prediction time, the data that pairs the two for training, and the metric that decides whether the model helped. Break any one piece and the model only looks smart on the notebook screen.
What learning means in code
A learning algorithm changes parameters so a loss on training examples decreases. The hope is that the same parameters also produce good predictions on examples the model has never seen. That hope is not automatic. It depends on the examples being representative, the target being well-defined, and the features being legal at prediction time.
What it looks like in production
In production, the model is one box in a much larger pipeline: feature extraction, scoring, threshold, decision, logging, monitoring, and feedback. The model card belongs in the same repo as the deploy script. If the team cannot point at the artifact and the metric on the same page, the project is not really ML yet.
Common failure
Treating the validation score as proof of intelligence. A 0.97 ROC-AUC on a notebook split tells you nothing if the features included post-event information or if the production data drifted away from the training distribution.