Sorting fruit: the challenge that introduces machine learning
The Data Science umbrella · click a field
Why fruit?
The same three steps run a self-driving car: mine camera data for patterns, learn a model that recognises a pedestrian, and let AI decide to brake. Fruit is simply small enough to follow every step by hand.
Walk one fruit through Data Mining, Machine Learning and AI
The ideas that make it work: features, labels, patterns and experience
Same table, with and without the answer
'Apples are usually red and smooth'
Performance P improves with experience E
The defining rule: learn from data, not from explicit programs
Apples vs mangoes on a redness scale
machine learning: Data + Answers → Rules
learned cut-off = (mean apple + mean mango) ÷ 2
Classify, regress or cluster: decide it by hand and by eye
Worked example by hand: label a new fruit by its nearest neighbour
New fruit X: size 5, redness 7. Three labelled fruits are on the table. Which one is closest?
Distance between two points: subtract the sizes, subtract the rednesses, square both, add them, take the square root. The fruit with the smallest distance lends X its label.
Click anywhere on the plot to place the new fruit there.
Decide the task: the lecture's examples
Where the rewards add up: State, Action, Reward and the cumulative reward
The arithmetic for that step appears here.
Gains vs losses
Cumulative reward
Worked example: a child learning to ride a bicycle, in 6 steps
The first five steps are the 5 components S, A, R, S', π. The sixth is how the policy gets better: by exploring and exploiting over many rides.
The family: supervised, unsupervised, reinforcement and transfer learning
Pick a column above.
Transfer learning: reuse a pre-trained model, fine-tune a few layers
Click a layer to freeze it or fine-tune it.
Spanish → Italian. Someone who speaks Spanish learns Italian much faster than someone starting from nothing: the grammar and many words carry over, only the differences need practice. Transfer learning reuses a model the same way.
The cost and the limits: the curse of dimensionality
Apply it yourself: choose the right learning type and set up Anaconda
Pick the learning type
Tutorial preparation: install Anaconda
# check that conda is installed conda --version # one environment for the course conda create -n cds6354 python=3.11 jupyter pandas scikit-learn matplotlib conda activate cds6354 # open the notebook interface in your browser jupyter notebook