Lesson 1.3 · 7 min read · about 50 min to master at a very slow pace

The ML Modelling Process

The practical workflow from problem definition to deployment, why it is a loop and not a pipeline, and the difference between an algorithm and its complexity.

Not startedJump to quiz

The workflow

  1. Define the problem and the decision the prediction will support. Decide the task type.
  2. Obtain and explore the data. Identify the target and candidate predictors. Look for missing values, odd units, duplicates.
  3. Split the data into training, validation and test sets before learning anything from it.
  4. Choose candidate models and fit them on the training data.
  5. Compare them on validation data, or by cross-validation.
  6. Inspect errors and assumptions. Go back and revise features, data or model.
  7. Evaluate the final model once on the test set, then deploy and monitor it.

A loop, not a pipeline

Step 6 sends you back to earlier steps. Evaluation often reveals that the task definition, the features or the model choice needs to change. What must not loop is the test set: it is used once, at the very end.

A revision analogy

Think of studying with past papers. Training data are the questions you practise on. Validation data are a mock exam you use to decide how to revise. Test data are the real exam, which you must not see in advance. If you memorise the practice answers you score 100% on them and may still fail the real exam. That is overfitting.

Algorithm vs complexity

Two different choices hide inside "choosing a model":

Model algorithmModel complexity
What it isThe learning techniqueHow flexible that technique is allowed to be
ExamplesLinear regression, logistic regression, decision tree, SVMPolynomial degree, tree depth, number of features, in K-NN, penalty
Tree example"Use a decision tree""Depth 2" (simple) vs "depth 20" (very flexible)

Settings that control complexity and are chosen by you rather than fitted from the data are called hyperparameters. Coefficients are fitted on the training set; hyperparameters are chosen on validation data.

Feature construction

The process includes building new features from domain knowledge: a ratio of debt to income, the day of the week from a timestamp, or to capture curvature. Task definition, features, model choice and evaluation are connected decisions, not isolated steps.

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

Going deeperWhat is the difference between model algorithm and model complexity?

The algorithm is the learning technique (logistic regression, decision tree, random forest...). The complexity is how sophisticated or flexible that particular model is allowed to be.

Example: a decision tree of depth 2 and one of depth 20 use the same algorithm but have very different complexity. The depth-20 tree can carve out tiny regions around individual training points, so it is far more likely to overfit.

Cheatsheet

ML workflow

Define problem → explore data → split → fit candidates on train → compare on validation/CV → inspect & revise → test once → deploy & monitor.

Hyperparameter

A setting chosen by you, not fitted from data (degree, depth, , , ). Choose it on validation data or by CV.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1conceptWhen should the data be split into training, validation and test sets?
Q2conceptWhich of these is a hyperparameter rather than a parameter fitted from data?
Q3conceptTeam A compares logistic regression with an SVM. Team B compares decision trees of depth 3 and depth 15. Which statement is correct?
Q4diagnoseAfter the final test, error analysis suggests a useful new feature. The team adds it, retrains, evaluates on the same test set again and reports the new, higher score. What's wrong?
Q5conceptWhy is the ML workflow described as iterative rather than a one-way pipeline?