What machine learning is and how it differs from AI
Artificial intelligence is the broad goal of making machines perform tasks such as perception, planning, language use and control. Machine learning is a subset of methods within it. Instead of a programmer writing rules by hand, a learning algorithm infers the rules from examples.
A robot is a separate idea. It is a physical machine that senses and acts. Many robots use machine learning for tasks like recognising objects, but some use only fixed, hand-written control rules.
How a model learns from data
Data is organised into features, the input measurements, and often a label, the correct answer. A model is a function with adjustable parameters that maps features to a prediction. A loss function scores how wrong the predictions are, and training adjusts the parameters to reduce that loss, usually by gradient descent.
The three main settings differ by feedback. In supervised learning, labels are provided, as in predicting house prices. In unsupervised learning, there are no labels and the algorithm finds structure, such as clusters. In reinforcement learning, an agent learns from rewards received after taking actions.
Worked example: fitting a line
Suppose a model predicts a price in thousands as y = 2x, where x is floor area in tens of square metres. Take three training houses: (x=1, y=3), (x=2, y=4), (x=3, y=7). The predictions are 2, 4 and 6. The errors are 1, 0 and 1.
The mean squared error is (1 + 0 + 1) / 3 = 0.67, rounded to two places. Training would adjust the slope and add an intercept to lower this number.
The model must then be tested on held-out data it never saw. If x=4 has a true y of 8 and the model predicts 8, the error is 0. A low training error with a high held-out error signals overfitting.
Common misconceptions
Machine learning is not the same as understanding. A model finds statistical patterns in its training data, and it can fail when new data differs from that data. A model also does not become correct simply by training longer, because it can memorise noise.
More data does not fix every problem. If the labels are biased or the data is unrepresentative, the model usually reproduces those flaws. Accuracy alone can also mislead, for example when 95 percent of cases belong to one class and a model that always predicts that class scores 95 percent.
Where it shows up
Common uses include spam filtering, recommendation, speech recognition, medical image analysis, fraud detection and demand forecasting. Robots use it for vision and for learning control policies. Language systems use neural networks trained on large text collections.
Behind each application sits a pipeline of data collection, cleaning, training, evaluation and monitoring. The model is only one stage of that process.
Key terms
- Feature
- An input measurement used by a model to make a prediction.
- Label
- The known correct output for an example, used in supervised learning.
- Loss function
- A formula that scores how far predictions are from the correct answers.
- Overfitting
- When a model fits noise in the training data and performs worse on new data.
- Supervised learning
- Learning from examples that include labels.
- Reinforcement learning
- Learning to choose actions by receiving rewards or penalties.
