Lecture 1
Lecture 1
SS/SE ZG568
• The science (and art) of programming computers so they can learn from data
• Engineering-oriented definition
• Algorithms that improve their performance P at some task T with experience E
Data Data
Computer Output Computer Program
Program Output
Defining the Learning Tasks
Improve on task T, with respect to performance metric P, based on experience
E
• Example 1
• T: Playing checkers
• P: Percentage of games won against an arbitrary opponent
• E: Playing practice games against itself
• Example 2
• T: Recognizing hand-written words
• P: Percentage of words correctly classified
• E: Database of human-labeled images of handwritten words
• Example 3
• T: Driving on four-lane highways using vision sensors
• P: Average distance traveled before a human-judged error
• E: A sequence of images and steering commands recorded while observing a
human driver.
• Example 4
• T: Categorize email messages as spam or legitimate.
• P: Percentage of email messages correctly classified.
• E: Database of emails, some with human-given labels
Traditional Approach to Spam Filtering
Spam typically uses words or phrases such as “4U,” “credit card,” “free,” and “amazing”
• Solution
• Write a detection algorithm for frequently
appearing patterns in spams
• Test and update the detection rules until it is
good enough.
• Challenge
• Detection algorithm likely to be a long list of
complex rules
• hard to maintain.
Machine Learning Approach
Automatically learns phrases that are good predictors of spam by detecting
unusually frequent patterns of words in spams compared to “ham”s
• The program is much shorter, easier to maintain, and most likely more
accurate.
A Classic example of ML Task
It is very hard to say what makes a “2”
Actually a
“3” not a “2”
All “2”s
A “3”
A “7”
More ML Usage Scenarios
Tasks that are best solved by using a learning algorithm
• Recognizing Patterns in images, text
• Facial identities or facial expressions
• Handwritten or spoken words
• Medical images
• Types of Applications
• Application Domains
• State of the Art Applications
Two Classes of Application
• Internet
• Computational biology
• Finance
• E-commerce
• Space exploration
• Robotics
• Information extraction
• Social networks
• Software engineering
• System management
• Creative Arts
Example: Classification
Assign object/event to one of a given finite set of categories
• Medical Diagnosis
• Credit card applications or transactions
• Fraud detection in e-commerce
• Worm detection in network packets
• Spam filtering in email
• Recommended articles in a newspaper
• Recommended books, movies, music, or jokes
• Financial investments
• DNA sequences
• Spoken words
• Handwritten letters
• Astronomical images
Example: Planning, Control, Problem Solving
Path
Planning
Laser Terrain
Mapping
Sebastian
Stanle
y
Contemporary ML Based Solutions
9
September Arctic Sea Ice
Extent (1,000,000 sq
8
7
6
5
4
3
2
km)
1
0
1970 1980 1990 2000 2010 2020
Year Number
Supervised Learning: Classification
y=1 (malignant)
y=0 (benign)
1 (malignant)
0 (benign)
Tumor Size Learnt classifer
If x>T, malignant else benign
Predict benign Predict malignant
x=T
Increasing Feature Dimension
• x can be multi-dimensional
– Each dimension corresponds to an attribute
- Clump Thickness
- Uniformity of Cell Size
Age
- Uniformity of Cell Shape
…
Tumor Size
Example: Supervised Learning
Techniques
• Linear Regression
• Logistic Regression
• Naïve Bayes Classifiers
• Support Vector Machines (SVMs)
• Decision Trees and Random Forests
• Neural networks
Unsupervised Learning
• Clustering
• k-Means
• Hierarchical Cluster Analysis
• Expectation Maximization
• Visualization and dimensionality reduction
• Principal Component Analysis (PCA)
• Kernel PCA
• Locally-Linear Embedding (LLE)
• t-distributed Stochastic Neighbor Embedding (t-SNE)
• Association rule learning
• Apriori
• Eclat
Data Visualization
Visualize 2/3D representation of complex unlabelled training data
• Preserve as much structure as possible
• e.g., trying to keep separate clusters in the input space from overlapping in the
visualization
• Understand how the data is organized
• Identify unsuspected patterns.
frog
cat
bird
dog
truck
automobile
deer
horse
ship
airplane
Applications: Unsupervised Learning
Genomics application: Group individuals by genetic similarity
Genes
Individuals
Applications: Unsupervised Learning
Organize computing clusters Social network analysis
• Examples:
– Game playing, e.g., AlphaGo
– Robot in a maze
– Balance a pole on your hand
Types of Learning
Based on how training data is used
• Batch learning
• Uses all available data at a time during training
• Mini Batch learning
• Uses a subset of available at a time during training
• Online (incremental) learning
• Uses single training data instance at a time during training
Types of Learning
Based on how training data is used
• Instance Based Learning
• compare new data points to known data points
• Model Based learning
• detect patterns in the training data and build a predictive model