Read a sample: 1. A Prediction Takes Root
Tomorrow morning, someone at a community garden will unlock the gate, walk past a row of vegetable plots, and decide which ones need water.
Some plots may be dry enough to need attention. Others may still have plenty of moisture from a recent shower. The gardener could inspect each plot by hand, and on many days that may be the most sensible approach. But imagine that the garden is growing, volunteers have limited time, and someone asks a practical question:
Could we use information from previous days to predict which plots will need watering tomorrow?
This book follows that question from its first uncertain sketch to a more careful assessment of the answer. Along the way, you will meet the ideas behind machine learning without needing to write code or study advanced mathematics. The garden is imaginary, but the reasoning is useful far beyond watering. The same habits can help you think about a recommendation system, a forecast, or a tool that flags transactions for review.
For now, picture a modest community garden with plots tended by different people. Some plots receive more sun than others. Some are shaded by a fence in the afternoon. The soil varies, the plants have different needs, and the weather changes from day to day. Volunteers share the watering work, but they do not always have time to examine every plot before planning the next morning’s tasks.
A prediction could help them prepare. It might suggest which plots deserve an early look, or whether to expect a busy watering shift. It would not make the soil wetter, guarantee tomorrow’s weather, or replace the judgment of the people caring for the plants. It would offer a reasoned guess based on information available before the outcome is known.
That distinction—between a guess informed by evidence and knowledge of what will happen—is where our tutorial begins.
The garden’s question sounds simple: will a particular plot need watering tomorrow?
Yet even a small decision depends on several things. Recent rain may matter. So may the amount of moisture already in the soil, the exposure of the plot, and the conditions expected before the next inspection. A sunny plot might dry more quickly than a shaded one, but sun alone does not tell us everything. A recent downpour could leave the sunny plot wet while a sheltered plot misses some of the rain.
Suppose a volunteer looks at Plot 4 late this afternoon. Its soil feels somewhat damp, there has been little recent rain, and tomorrow is expected to be warm. The volunteer might predict that Plot 4 will need water in the morning. Another volunteer, considering the same information, might decide that it can wait until the afternoon.
Neither person has observed tomorrow’s soil yet. Both are using what they know now to anticipate a later condition. Their predictions could differ because they weigh the evidence differently, because they have different experience, or because they mean different things by “need water.”
That last phrase deserves attention. Does a plot need water when the top layer feels dry? When a moisture reading falls below a chosen level? When a gardener judges that the plants should be watered before the next visit? Different answers could produce different records, even if everyone is trying to be helpful.
We do not have to settle that definition immediately. We do need to recognize that a prediction has a target: the thing we are trying to anticipate. In our garden, the broad target is whether a plot will need watering tomorrow. In the next chapter, we will make that question more precise so that people can collect examples and interpret the result consistently.
For the moment, think of the prediction as a note left for the morning volunteer:
> Plot 4: likely to need watering. Check it early.
The note is useful only if the volunteer understands what it means and can decide what to do with it. A prediction is part of a decision process, not the decision process itself.
It is tempting to imagine a prediction tool as a window into the future. A better image is a gardener looking through the gate at dusk: the view contains clues, but it is incomplete.
Weather may change overnight. A hose may be left running. A volunteer may water a plot after the prediction is made. A sensor may give an inaccurate reading. The plants themselves may have needs that the available records do not capture. Even with good information, tomorrow can unfold in more than one way.
This does not make prediction pointless. A weather forecast can help you decide whether to carry a raincoat without promising exactly when each raindrop will fall. In the same way, a garden prediction can help volunteers plan their time without guaranteeing the condition of every plot.
It also matters that there are different ways to be wrong. If a prediction says a plot will not need water and the plot does need it, the volunteer might overlook it. If the prediction says a plot will need water and it does not, the volunteer might spend time checking or watering unnecessarily. The consequences depend on what people actually do with the prediction. A reminder to inspect is different from a system that opens a valve automatically.
Those differences will become important when we evaluate results. A tool that gets many predictions right overall may still miss the…