AI Glossary / AI and machine learning / Beginner
Machine learning
Definition
Machine learning is the study and practice of creating systems that learn useful patterns from data or experience to perform a task. Instead of writing every decision rule by hand, developers use a learning procedure to build a model. Success is judged by how well it performs the intended task on appropriate new cases, not simply by remembering its training examples.
What it means
Imagine predicting how many lunches a small café will sell. A learning system might use past sales, day of the week and other information to fit a prediction model.
People still make important choices: what to predict, which information to use, how errors are measured and whether the results are suitable.
The phrase does not mean that every deployed model keeps changing. Many models are trained, tested and then used with fixed parameters until a separate update takes place. Making a prediction with such a model is called inference.
How it works
A typical supervised-learning project starts with examples containing inputs and known target answers. The training procedure adjusts a model to reduce an error measure. Inputs might describe a café's circumstances; the target might be the number of lunches sold.
Developers compare candidate models using validation data and reserve separate test data for a final assessment. The split must reflect the use case: for a forecast, testing on later dates is usually more realistic than allowing future information into training.
Other forms of learning use different feedback. Unsupervised learning looks for structure without supplied target answers. Reinforcement learning uses feedback about the consequences of actions. All require a clear account of what is being learned and how improvement will be assessed.
Three practical examples
- Café planning: A model estimates daily demand from information available before orders are placed. Staff use the estimate alongside knowledge of special events.
- Personal organization: A photo application groups visually similar pictures, helping someone browse an archive without requiring a predefined label for every group.
- Customer service: A model learns from previously categorized requests to suggest a queue for a new message. Reviewers check unusual cases and monitor whether categories change over time.
Think of it this way
Think of learning a recipe adjustment by trying examples. You compare the result with your aim and change the proportions. But a recipe that works for one oven may fail in another. Similarly, fitting past examples does not guarantee success under different conditions. The analogy helps explain adjustment and testing; a model does not need to experience taste, intention or understanding to change numerical settings.
Worked example
Consider an original simplified model that predicts lunches sold from the number of advance reservations. It uses the rule predicted lunches = a + b times reservations. Training examples are (10 reservations, 30 lunches), (20, 40) and (30, 50).
The relationship a=20 and b=1 fits all three examples exactly. This gives predictions of 30, 40 and 50 lunches, with zero error on those examples. Many more flexible rules could also fit three points, so exact training fit alone is weak evidence.
Now test the fixed model on two later days: (15 reservations, 38 lunches) and (25, 41). It predicts 35 and 45. The absolute errors are three and four lunches, so mean absolute error is (3 + 4)/2 = 3.5 lunches.
A fixed baseline of 40 lunches makes errors of two and one, averaging 1.5 lunches. On this tiny test, the baseline performs better. This shows why a learned relationship needs comparison with alternatives on new data. The arithmetic illustrates evaluation, not a reliable demand forecast.
Illustrative case study
Fictional case: Maple Lunches builds a demand model using booking counts and sales records. An early version includes a field recording how many meals were prepared after the morning rush began. That information would not exist at the actual ordering time.
The team removes the unavailable field, evaluates predictions on later weeks and compares them with a simple average. It also records days when a sold-out menu means observed sales understate demand. Staff keep the model as a planning aid while investigating these limitations. The invented case illustrates leakage and measurement problems rather than claiming that a model has improved the café's finances.
Common misconceptions and mistakes
More data does not automatically fix wrong labels or a mismatch between training conditions and intended use. A model can learn an accidental association that later disappears.
Excellent training performance can reflect overfitting: the model captures details that do not carry over to new cases. Another mistake is repeatedly choosing improvements based on the test set; that gradually turns the test into part of development. Finally, a useful prediction does not establish cause. Reservation counts might help forecast lunches without proving that changing reservations alone changes demand by a fixed amount.
Business use
Before training anything, define the decision the prediction will support. A café may care more about costly shortages than small overestimates, so a convenient average error should not be the only business measure.
Check whether the required inputs will exist at prediction time. Compare a straightforward baseline, record performance on fresh cases and plan how to detect changing conditions. A model is useful when it improves the real decision process, not merely when its training chart looks convincing.
People also ask
Must machine learning use a neural network?
No. Linear models, decision trees and many other methods also learn from data.
Is training the same as inference?
No. Training builds or adjusts the model; inference applies it to an input.
Does a prediction explain why something happens?
Not necessarily. Predictive association and causal explanation are different questions.
Check your understanding
What was the learned model's test error in the example?
Answer: Mean absolute error was 3.5 lunches.
What was the baseline's error?
Answer: 1.5 lunches.
Why was the prepared-meals field unsuitable?
Answer: It was unavailable when the ordering decision had to be made.
Did zero training error establish a useful model?
Answer: No.
Related terms
- Inference
- Supervised learning
- Unsupervised learning
- Reinforcement learning
- Overfitting
- Data leakage
- Generalization
- Training data
Learn next
Build a small table of predictions and actual results for a familiar task. Calculate absolute errors and compare them with a simple baseline. Separate information known before the decision from information only learned afterwards.
More in AI and machine learning
- Lost-in-the-middle effect - The lost-in-the-middle effect is the tendency of language models to use information at the beginning and end of a long input well, but to miss or garble...
- M-separation - M-separation is a graphical criterion for reading conditional-independence implications from mixed graphs, including ancestral graphs.
- M-theory (learning framework)
- Machine learning as a service - Machine learning as a service is the delivery of ML capability over the internet as a metered product: instead of building models in-house, you call a...
- Machine learning control - Machine learning control is the use of machine-learning methods to develop or improve control laws that determine a system's actions from observations.
- Machine Learning Pipeline - A machine learning pipeline is the ordered chain of steps that turns raw data into predictions: collection, cleaning, features, training, evaluation and...
Sources
Poole and Mackworth, Learning Issues: https://artint.info/3e/html/ArtInt3e.Ch7.S1.html Google Machine Learning Crash Course, Dividing the original dataset: https://developers.google.com/machine-learning/crash-course/overfitting/dividing-datasets Both consulted for learning and evaluation principles. The café data, calculations, recipe analogy and Maple case are original educational illustrations.
Previous: Machine ethics Next: Machine learning as a service