Thinking with Machine Learning
What patterns can teach us about nature, systems and ourselves.
A hundred years of rainfall records may look like a collection of irregular numbers. Some years are unusually wet, others exceptionally dry. There may be several years of similar conditions before a sudden change interrupts the sequence.
Arrange those observations in chronological order, however, and we can begin asking different questions. Are there recurring patterns? Have the extremes become more frequent? Does the distribution of rainfall change across the decades?
This is the fascination of time series analysis. Each observation belongs to a particular moment, but its relationship with those before and after it may reveal something about the behaviour of a larger system.
When I returned to studying machine learning in 2019, I became interested in how computational methods could identify relationships within complex data. Rather than defining every possible rule ourselves, we could develop models that learned statistical patterns from examples.
The natural world offers an extraordinary range of questions for this kind of analysis.
The timing of spring flowering, the changing temperature of the oceans, the movement of migratory birds and the growth of forests can all be studied through observations collected over time.
Yet these processes do not respond to a single variable. A tree's growth may depend on rainfall, temperature, soil conditions, available light and the effects of previous seasons. The relationships are often complex, and some of the influences may remain unmeasured.
A model may identify a statistical pattern within those observations. Understanding why it exists requires us to look beyond the pattern itself.
The importance of time
Time series analysis differs from examining a collection of unrelated measurements because the order of observations matters.
Consider daily temperature readings taken over several decades. Plotting them reveals the familiar rise and fall of the seasons, with temperatures generally increasing towards summer and decreasing towards winter.
But within that repeating cycle are considerable variations. One spring may be unusually cold, another exceptionally warm. A succession of dry summers may be followed by a period of heavy rainfall. Longer records may reveal changes that are difficult to recognise from the experience of any single year.
To understand what is happening, we need to distinguish between several different features of the data.
There are seasonal cycles, longer-term trends and irregular variations. These can overlap, making it difficult to determine whether a particular change is temporary or part of a more persistent development.
Machine learning provides methods for examining such relationships, especially when many variables interact.
For example, a model might use historical temperatures, rainfall, soil moisture and other observations to estimate when a particular plant is likely to flower. With sufficient suitable data, it may identify combinations of conditions associated with earlier or later flowering.
The resulting prediction may be useful for agriculture, ecological research or understanding changes in seasonal behaviour.
Yet even a highly accurate prediction leaves questions unanswered.
Which conditions are most important? Are the relationships consistent across different locations? Would the model perform as well during an unusually hot or wet year? And how much of what it has learned reflects the underlying biological process rather than features particular to its training data?
These questions matter because the natural world is continually changing.
When patterns become misleading
One of the most important lessons in machine learning is that finding a pattern does not guarantee that we have discovered a dependable relationship.
A sufficiently flexible model can sometimes fit historical observations remarkably well, including variations that arose through chance. This is known as overfitting.
The model appears successful because it has learned the particular characteristics of the data it was given. When presented with new observations, however, its performance may deteriorate.
This is why testing a model on information it has not previously encountered is essential.
With time series data, the distinction is especially important. We must respect the order in which observations became available. A model intended to predict future conditions should be evaluated on later periods, without allowing information from those periods to influence its earlier training.
Otherwise, we risk creating the appearance of predictive ability that would never have existed in practice.
There is another difficulty. The relationships within a natural system may themselves change.
A model trained on historical flowering dates might perform well under familiar climatic conditions. But as temperatures, rainfall patterns and other environmental factors change, relationships learned from the past may become less reliable.
This does not make the earlier observations worthless. It means we must understand the conditions under which our conclusions hold.
The same principle applies throughout scientific investigation. A result is more convincing when it survives careful testing, including attempts to discover where it fails.
What a model can tell us
A machine learning model is a representation of selected aspects of the world.
To construct one, we decide which observations to collect, how to describe them and what outcome we want to estimate. Those decisions determine much of what the model can learn.
If we are interested in the growth of a forest, we might measure temperature, rainfall, soil moisture and changes in vegetation cover. These observations can reveal valuable relationships, particularly when gathered consistently across many years.
But the forest contains far more than the variables in our dataset.
Soil organisms, competition between plants, disease, disturbances and local differences in terrain may all influence what happens. Some of these can be measured; others may be difficult to observe or absent from the available records.
A model can still be useful without representing every detail. Indeed, simplifying a complex system is often necessary if we are to study it at all.
The important question is whether we understand what has been included, what has been excluded and how those choices affect our conclusions.
This is where I find computational thinking particularly valuable.
It encourages precision in the questions we ask. What are we trying to understand? What evidence would support an explanation? How might we test it? What alternative explanations have we overlooked?
It also encourages a willingness to revise our understanding when new observations contradict what we expected.
I have always found this aspect of scientific inquiry compelling. A result that challenges an assumption can be as informative as one that confirms it.
Patterns and understanding
Human beings have recognised patterns in the natural world for thousands of years.
Long before modern instruments, people observed the movement of the sun, the return of the seasons, the behaviour of animals and the conditions associated with successful harvests. Such knowledge accumulated through repeated observation and was refined across generations.
Today, satellites, environmental sensors and computational models allow us to examine processes on scales that were previously inaccessible.
We can study changes across oceans, forests and atmospheric systems, bringing together observations from different locations and periods of time.
Machine learning has become one of the tools available for working with this information.
Its strength lies partly in its ability to identify statistical relationships within complex datasets, including relationships that may be difficult to recognise through conventional analysis.
Yet recognising a pattern, predicting an outcome and explaining a process are different achievements.
A model may predict an earlier flowering season without establishing which biological mechanisms are responsible. It may identify changes in vegetation without explaining every ecological interaction that contributed to them.
Scientific understanding develops when these findings are considered alongside experiments, established knowledge, field observations and competing explanations.
The computational result becomes part of a larger investigation.
I find this relationship between different ways of knowing especially interesting. Detailed observation gives us information about particular places and events. Long records allow us to examine change across time. Computational methods help us investigate relationships that might otherwise remain hidden.
Each contributes something different.
And each has limitations that become important when we attempt to draw conclusions.
Learning to question the pattern
Studying machine learning has influenced the way I approach information.
When I encounter an apparent pattern, I am interested in the observations behind it. How long was the period studied? Were the measurements consistent? What happened during unusual years? Would the same relationship appear in another location or under different conditions?
These questions can make an explanation more complicated, but they can also make it more reliable.
Nature rarely provides us with perfectly controlled conditions. A single season may contain several unusual events, and their effects may continue long after the weather has changed. Some influences are immediately visible, while others emerge gradually through repeated observation.
The challenge is to recognise what the evidence can support without asking it to tell us more than it contains.
I remain fascinated by what machine learning makes possible. The ability to examine extensive records, identify complex relationships and test predictions has opened new ways of investigating the natural world.
But perhaps the most valuable part of working with these methods is the discipline of questioning our conclusions.
When a pattern emerges from the data, it gives us a reason to investigate further.
The next question is whether we understand why it is there.