Introduction to AI/ML

Learning Patterns

Machine learning finds a pattern from examples of inputs and outputs, then uses it on new inputs.

Glassdoor case study

YOESalary
130,000
240,000
460,000
3?
3 years → 50,000

Plot the examples: years of experience (input) against salary (output).

The pattern: a straight line, \(y = mx + c\), with \(m = 10{,}000\) and \(c = 20{,}000\).

Programming vs machine learning

Sketch: input and output go into an ML program, a pattern comes out
Machine learning: input + output give the pattern
Sketch: input and pattern go into a normal program, output comes out
Programming: input + pattern give the output

Finding, then using, the pattern

Sketch: YOE and salary go into finding a pattern, which gives y = mx + c
Training: find the pattern from YOE and salary
Sketch: a new YOE and the pattern go into using the pattern, which gives a salary
Inference: use the pattern on a new YOE

Machine learning model

Training: input and output go into an ML algorithm that produces a model; inference: a new input goes through the model to give a prediction

Problems with unknown models

Nobody knows the formula for a car's price, a flat's value or whether an email is spam. We learn it from data.

Website: sell your car for the best price
Factors in a car's price: age, mileage, brand, fuel type, location and more
A table of used-car data: year, selling price, kilometres driven, fuel type
App ad: check property value with PropWorth
Email filter sorting messages into inbox and spam

Problems with known models

Here the pattern is already known, so there is nothing to learn: just compute.

Ohm's law: I = V / R
Ohm's law
Newton's law of gravitation between the Earth and the Moon
Newton's law of gravitation

Core types of learning

Supervised learning Unsupervised learning Reinforcement learning Self-supervised learning

Advanced types of learning

Semi-supervised learning Weakly supervised learning Active learning Meta-learning Transfer learning Zero-shot, one-shot, few-shot learning Continual learning Online learning Multi-task learning Federated learning Representation learning

Tasks

  1. ClassificationWhich class? A boundary splits the labels.
  2. RegressionHow much? A line through the numbers.
  3. Clustering / density estimationWhich group? No labels given.
  4. Dimensionality reductionFewer numbers per point, little lost.