Skip to content
Queensferry

Module 18 · Lesson 18.1

What it is actually doing

Fitting a function to samples — and what that implies about every claim made for it.

Why this matters

This module is written to be useful in five years, which rules out describing what any particular system can currently do. Capability claims date faster than a page can be maintained, and the course's currency register says so explicitly.

What does not date is the mechanism. A trained model fits a function to samples, and every strength and every failure mode follows from that one sentence — including the ones that will still be true of whatever replaces today's methods.

By the end of this lesson you should be able to

  • State what a supervised model is doing in one sentence
  • Distinguish supervised, unsupervised and reinforcement learning by what each requires
  • Explain features and labels and why choosing features is engineering
  • Say why correlation is what these methods find

What you should already know

  • Curve fitting and least squares
  • The distinction between a model and the thing it models (Module 1)

The one sentence

Supervised learning fits a function to examples, so that it can be evaluated at inputs it has not seen.

Give it pairs — an input and the answer — and it adjusts parameters until it reproduces those pairs well. Then it is evaluated somewhere new.

That is the same thing a structural engineer does when they fit a curve through test data and read a value off it. The differences are of scale, not of kind: many more parameters, many more dimensions, and a fitting procedure nobody watches. The strengths and failures are the ones curve fitting has always had.

The three families

Supervised. You have inputs and the right answers. Regression predicts a number, classification predicts a category. This is nearly all of what is useful in structural engineering, and it is the family that needs labelled data — which is usually the binding constraint, because labelling engineering data means an engineer looking at each case.

Unsupervised. You have inputs and no answers. Clustering finds groups; anomaly detection finds outliers. Useful for 'which of these 4 000 models are unusual?' — a question worth asking of a model library, and one nobody has time to answer by hand.

Reinforcement. An agent takes actions and receives rewards. Included here for completeness. It needs an environment it can act in millions of times, which structural design is not.

Features and labels

The label is what you are predicting. The features are what you predict it from.

Choosing features is the engineering, and it is where domain knowledge earns its place. A model given span, depth and load has a chance. A model given the project number and the month of issue will find a correlation — because there is always some correlation in finite data — and it will mean nothing.

This is also where the most common failure originates. If a feature encodes the answer indirectly, the model learns the shortcut rather than the relationship. A model predicting whether a beam passes, given a feature that includes the utilisation, has been handed the answer and will score beautifully on data it should not be able to predict at all.

Correlation, not causation

These methods find patterns that co-occur in the data they were shown. Nothing in the mechanism distinguishes a causal relationship from a coincidental one, and finite data always contains coincidences.

For a structural engineer that has a specific consequence. Where a deterministic relationship exists — where equilibrium, or a material law, or a code rule gives the answer — a fitted approximation to it is strictly worse: less accurate, less transparent, and unable to say when it is outside its range.

Where a deterministic method exists, use it. Machine learning is for the questions where the deterministic method is judgement — which is a real and large category, and not the one that includes calculating a bending moment.

Where it belongs in structural work

Six uses that fit the mechanism, rather than fighting it:

Recommendation. Suggesting a starting section, a likely grid, a plausible foundation type. The engineer decides; the suggestion saves a first pass.

Classification. Sorting model warnings, drawings, defect photographs, correspondence. High volume, tolerant of error, and a human reviews the output anyway.

Anomaly detection. 'This model is unlike the others' is a question no deterministic method answers and no engineer has time to ask across a whole library.

Pattern recognition. Reading structural monitoring data for changes that would take a person weeks to notice.

Surrogate modelling. Fitting a fast approximation to a slow analysis, to explore a design space in seconds rather than days. The third lesson of this module is about what that costs.

Information retrieval. Finding the relevant clause, the relevant precedent, the relevant past project.

What these share: the output is a suggestion to a human, the cost of being wrong is bounded, and there is usually a deterministic check available afterwards.

Where it does not belong

Anywhere the answer is determined and computable. Member forces, load paths, section capacities, code compliance. Not because a model could not approximate them, but because an approximation is worse than the thing it approximates, and because it cannot tell you when it has gone outside what it saw.

Check yourself

A model is trained to predict whether a steel beam passes its design checks, from features including span, load, section properties and the computed utilisation ratio. It scores 99.8 % accuracy. What is wrong?

Practice

A classifier is tested on 240 cases and gets 217 right. What is its accuracy, as a percentage to one decimal place?

Worked example

Reading a confusion matrix nobody has explained

Given

  • A classifier sorts 500 model-audit cases into 'has a restraint error' and 'does not'
  • Of the 100 cases that really do have a restraint error, it finds 72
  • It also flags 40 cases that do not have one

Find

Accuracy, precision and recall — and which of the three is misleading here

    Practice

    A classifier flags 112 cases as having a defect. Of those, 72 really do. What is its precision, as a percentage?

    Practice

    The same classifier finds 72 of the 100 cases that really have the defect. How many defective models does it let through?

    Practice

    A classifier is applied to a population where only 2 % of models have the defect. It flags nothing at all. What accuracy does it report?

    Check yourself

    A vendor reports 94 % accuracy for a defect classifier. What is the first question to ask?

    Check yourself

    What does a classifier's 'confidence' of 0.94 actually describe?

    Predict first

    A classifier trained on steel frames is shown a timber frame. What does it do?

    Summary

    • Supervised learning fits a function to examples so it can be evaluated somewhere new
    • Supervised needs labels, which usually means an engineer looking at each case
    • Choosing features is where domain knowledge earns its place
    • A feature downstream of the label produces a brilliant, worthless model
    • These methods find correlation; where a deterministic method exists, use it
    Progress is kept in this browser only.

    This is educational material. It uses simplified examples to teach principles, and must not be relied on for real design or safety-critical decisions. Module overview and checkpoint