Machine Learning: Foundations & Models
Source: Unit 1 §1
What machine learning is
In our world we have humans and computers. Humans learn from experience; computers traditionally follow instructions. The question that starts the subject is whether a computer can learn from experience too, and the answer is yes, provided you accept that a computer's word for "experience" is data.
The two broad phases
| Phase | What happens |
|---|---|
| Training | Use data to create and fine-tune a predictive model. |
| Prediction | Use the trained model to serve predictions on previously unseen data and answer queries. |
The seven steps to machine learning
- Gathering data - collect raw data.
- Data preparation - clean, format, split.
- Choosing a model - pick an algorithm.
- Training - fit the model to the data.
- Evaluation - test on unseen data.
- Parameter tuning - improve performance.
- Prediction - deploy and answer queries.
Gather → Prepare → Choose → Train → Evaluate → Tune → Predict.
Formal definitions
Herbert Simon: "Learning is any process by which a system improves performance from experience."
Tom Mitchell (1998): Machine Learning is the study of algorithms that improve their performance P at some task T with experience E. A well-defined learning task is given by the triple ⟨P, T, E⟩.
- T (task) - playing checkers.
- P (performance measure) - percentage of games won.
- E (experience) - playing practice games against itself.
"Learn to play checkers" is not a learning task, because Mitchell's definition is a triple. Without P you cannot tell whether learning happened, and without E you have not said what the learner is allowed to see.
When machine learning is the right tool
- Human expertise does not exist - navigating on Mars.
- Humans cannot explain their expertise - speech recognition.
- Models must be customised - personalised medicine.
- Models are based on huge amounts of data - genomics.
The classic hard task is recognising a handwritten 2. Writing down the rules for what makes a 2 a 2 is very hard; learning it from examples is easy. That gap is the whole argument for the field.
| Category of task | Examples |
|---|---|
| Recognising patterns | facial identities and expressions, handwritten or spoken words, medical images |
| Generating patterns | generating images or motion sequences |
| Prediction | future stock prices, currency exchange rates |
The three broad categories
| Type | Given | Goal |
|---|---|---|
| Supervised (inductive) | training data + desired outputs (labels) | learn a mapping input → output |
| Unsupervised | training data without labels | find hidden structure, e.g. clustering |
| Reinforcement | rewards from a sequence of actions | learn a policy, state → action |
Supervised learning
Given pairs , learn a function that predicts from . The type of splits the family in two.
Unsupervised learning
Given without labels, output the hidden structure behind the 's. The canonical instance is clustering: in genomics, group individuals by genetic similarity when nobody has told you which groups exist.
Reinforcement learning
Given a sequence of states and actions with (possibly delayed) rewards, output a policy - a mapping from states to actions that tells the agent what to do in each state.
Designing a learning system
- Choose the training experience - what data, and how it is gathered.
- Choose exactly what is to be learned - the target function.
- Choose how to represent the target function.
- Choose a learning algorithm to infer the target function from the experience.
The OSI analogy for the ML pipeline
The slides map the ML pipeline onto the seven-layer OSI stack to show it as a layered flow, with raw data at the bottom and decisions at the top.
| OSI layer | ML pipeline stage | Level |
|---|---|---|
| Application | Application / decision making | high |
| Presentation | Decision making | |
| Session | Classification | |
| Transport | Feature extraction | |
| Network | Segmentation | |
| Data link | Processing | |
| Physical | Raw input data | low |
Takeaway: ML transforms raw input data → segmentation → feature extraction → classification → decision, layer by layer.