SlideShare a Scribd company logo
INTRODUCTION TO MACHINE
LEARNING
CHILD LEARNING
Child:Daddy what is danger?
Dad: The possibility of suffering harm or injury.
Child:Daddy what is an injury?
Dad: An instance of being injured.
Child:Daddy what is an instance?
Dad: An example or single occurrence of something.
Child:Daddy does it bother you that I’m asking so many
questions?
Dad: Not at all, if you don't ask you will never know.
CHILD LEARNING
Dad: Let me give you some examples…
CHILD LEARNING
Child:Now I understand, everything is dangerous
Dad: No, there are things that aren't dangerous
CHILD LEARNING
Child:And what are those?
CHILD LEARNING
And there is the most natural mode of learning
Action Reaction Lesson
Touching hot stove aching hand Do not touch again
Playing with toys Fun Continue playing
Running in to the road Screaming parent Don’t run to roads
Running in the house Fun Run in the house
Eating chocolate Fun Search for chocolate
Eating too much chocolate Stomach ache Don’t eat too much
Saying bla bla No Reaction Try variations
Saying daddy Overexcited parents Do that again
SO, HOW CHILDREN LEARN?
1. From explanation
2. From examples
3. Reinforcement Learning
SO, HOW CHILDREN LEARN?
1. From explanation
2. From examples
3. Reinforcement Learning
ABOUT US
Algorithms Technology
Business
AGENDA
• What is Machine Learning
• Typical Machine Learning Tasks
• Supervised Learning
• Unsupervised Learning
• How to Get Started
• Summary
AGENDA
• What is Machine Learning
• Typical Machine Learning Tasks
• Supervised Learning
• Unsupervised Learning
• How to Get Started
• Summary
WHAT IS MACHINE LEARNING?
We say that a computer program is learning a task, if its
performance on that task is improving as more experience is
processed
WHAT IS MACHINE LEARNING?
Machine
Learning
Statistics
Databases
& Big Data
Decision
Theory
Artificial
Intelligence
Optimization
WHAT IS MACHINE LEARNING?
Machine
Learning
Statistics
Databases
& Big Data
Decision
Theory
Artificial
Intelligence
Optimization
Data Science
AGENDA
• What is Machine Learning
• Typical Machine Learning Tasks
• Supervised Learning
• Unsupervised Learning
• How to Get Started
• Summary
TYPICAL MACHINE LEARNING TASKS
No two Machine Learning tasks are identical. Yet, we often use
the following categories:
• Supervised Learning
• Unsupervised Learning
• Reinforcement Learning
SUPERVISED LEARNING
Estimate or Predict an unknown result, given explicit values of some
explaining features.
The learning takes place as history of observations, for which both the
explaining features and the results are known.
Experience = supervised examples (exactly as in inferring what is dangerous
from examples)
We call the dataset that describe the experience training set
SUPERVISED LEARNING
Estimate or Predict an unknown result, given explicit values of some
explaining features.
We call the dataset that describe the experience training set
When the unknown result is numeric, we call the task Regression
When the unknown result is categorical, we call the task Classification
SUPERVISED LEARNING
Example 1: What will be the annual spent of a new customer,
given a set of explaining features (e.g., demographics, first
purchases, first deposit etc.)?
Task qualifications: Prediction, Regression
Training set: a file, in which each row represents a customer. For
each such customer we will extract the explaining features, at
the prediction point, as well as the annual spent (a year later).
SUPERVISED LEARNING
Example 2: What is the activity currently performed by a user
who is wearing a smart watch with inertial sensors?
Task qualifications: Assessment, Classification
Input: A set of sensor-based signals, along with an annotation of
the activity during each signal.
Requires a significant amount of pre-processing in order to
produce the training set.
SUPERVISED LEARNING
PredictionAssessment
Classification
Regression
UNSUPERVISED LEARNING
Given a specific set of records, described by a given set of
features, either:
1. Extract interesting patterns that appear in the data
2. Provide insightful representation of the distribution of the
data
Experience: the more records we have, the more significant are
the patterns that we can extract, or more accurate is the
representation
UNSUPERVISED LEARNING
Example: Market Segmentation
Input data: Customers’ descriptions
Objective: Provide an insightful representation of the market
(what types of customers are there?)
Also known as cluster analysis
REINFORCEMENT LEARNING
Learning how to best react to situation through trial and error.
Simple Example: Multiple A/B testing
More Typical: Robot Navigation
Designing a RL system requires solving two difficult challenges:
• The exploration – exploitation dilemma
• Attributing delayed rewards
UNSTRUCTURED INPUTS
The input data often come in an unstructured form, such as:
• Free text
• Speech
• Images
• Video
• Sensors
• Networks
AGENDA
• What is Machine Learning
• Typical Machine Learning Tasks
• Supervised Learning
• Unsupervised Learning
• How to Get Started
• Summary
SUPERVISED LEARNING
X1 X2 X3 … Xn-2 Xn-1 Xn Y
x1,1 x2,1 x3,1 … xn-2,1 xn-1,1 xn,1 y1
x1,2 x2,2 x3,2 … xn-2,2 xn-1,2 xn,2 y2
.
.
.
.
.
.
.
.
.
…
…
…
.
.
.
.
.
.
.
.
.
x1,m-1 x2,m-1 x3,m-1 … xn-2,m-1 xn-1,m-1 xn,m-1 ym-1
x1,m x2,m x3,m … xn-2,m xn-1,m xn,m ym
𝑌 = 𝑓 𝑋1, 𝑋2, … , 𝑋 𝑛
LEARNING THE CONCEPT OF A BIRD
An alien asks you: “What is a bird?”
You can try and define a bird, but the alien does not understand
Why don’t you give an example…
LEARNING THE CONCEPT OF A BIRD
Is Bird?Can Fly ?ColorExample #
YesYesBlack1
What do you say about the following classification model:
“If Color = Black and Can_Fly = Yes then Bird
Else Not_Bird”?
LEARNING THE CONCEPT OF A BIRD
Is Bird?Can Fly ?ColorExample #
YesYesBlack1
YesYesGrey2
What do you say about the following classification model:
“If Can_Fly = Yes then Bird Else Not_Bird”?
LEARNING THE CONCEPT OF A BIRD
Is Bird?Can Fly ?ColorExample #
YesYesBlack1
YesYesGrey2
NoYesBlack3
Supervised Learning means generalizing from given
observations.
GENERALIZATION VS. SPECIFICATION
• A general concept is built based on the explaining features. The
right set of explaining features is crucial for learning
• Being over specific means memorizing and not learning
• Being too general means being too coarse and missing some of
the details
• Finding the sweet spot between generalization and specificity is
hard
GENERALIZATION VS. SPECIFICATION
Let us find a function that estimates Y=f(X)
Introduction to Machine Learning
Too General / Too
Simple / Under
fitted
Too Specific / Too
Complex / Over
fitted
A nice solution to
the trade-off
OVER FITTING & UNDER FITTING
• We search for
• We know that in addition to the functional dependency (called
bias), the actual Y values are also affected by noise (called
variance)
• We want the model to learn the bias, but not to be affected by
the variance.
• A model that is too simple to learn the bias is called under fitted
• A model that is overly complex that it adapts itself to the
variance is called over fitted
𝑌 = 𝑓 𝑋1, 𝑋2, … , 𝑋 𝑛
The more complexity you add to the
model, you can always better fit it to
the training observations.
This is not always a good practice!
A PARTIAL LIST OF SUPERVISED
LEARNING METHODS
• K- Nearest Neighbor
• SVM (Optimal Margin Linear Separation)
• Decision Trees
• Naïve Bayes
• Linear Regression
• Logistic Regression
• (Deep) Neural Networks
A PARTIAL LIST OF SUPERVISED
LEARNING METHODS
• K- Nearest Neighbor
• SVM (Optimal Margin Linear Separation)
• Decision Trees
• Naïve Bayes
• Linear Regression
• Logistic Regression
• (Deep) Neural Networks
K-NN
Recipients
EmailLength
Given a new observation, find
the K closest available
observations and:
• In regression, use the
average result of these K
observations
• In Classification, use voting
amongst these K
observations
K-NN
Recipients
EmailLength
K=3
Few concerns:
• What should be k?
• Which distance measure should
be used?
• Computation
LINEAR SEPERATORS
How would you classify
this data?
X1
X2
LINEAR SEPERATORS
How would you classify
this data?
X1
X2
LINEAR SEPERATORS
X1
X2
LINEAR SEPERATORS
X1
X2
In SVM we search for
the linear separator
that has the maximal
margin.
Using a
mathematical trick,
called The Kernel
Trick, SVMs can also
find non-linear
separators
DECISION TREES
Example: classify new customers into one of two groups:
Standard and VIP.
Training set: a list of customers that were once new, along with
an annotation that reflect if these customers should have been
identified as VIP (this annotation is made only after some time).
Let us say that we have 1,000 VIPs and 4,000 Standard new
customers
DECISION TREES
Let us say that we have 1,000 VIPs and 4,000 Standard new
customers
1,000 V
4,000 S
DECISION TREES
The population is a mix of different types. What if we could find
splitting criterion that will create two (or more), more pure sub
populations
1,000 V
4,000 S
DECISION TREES
The population is a mix of different types. What if we could find
splitting criterion that will create two (or more), more pure sub
populations
1,000 V
4,000 S
Self Employed
600 V
800 S
Employees
400 V
3,200 S
DECISION TREES
Now, we can take each sub-population and split it recursively,
until some stopping criteria are met.
1,000 V
4,000 S
Self Employed
600 V
800 S
Employees
400 V
3,200 S
DECISION TREES
• Decision trees are a result of recursive splitting mechanism
• Each split is chosen as to maximize the purity of the sub
populations that results from the split
• Few ways to model node purity. Often the concept of minimal
entropy (or a variation of minimal entropy) is used
• Each split is made according to the values of one of the
explaining features
LINEAR REGRESSION
0
50
100
150
200
250
300
350
400
450
0 1000 2000 3000
HousePrice($1000s)
Square Feet
LINEAR REGRESSION
0
50
100
150
200
250
300
350
400
450
0 1000 2000 3000
HousePrice($1000s)
Square Feet
SUPERVISED LEARNING EVALUATION
Since Supervised Learning is all about generalization, a good
model is a model that can be applied successfully to new
observations
In classification tasks, we are often interested in the probability
that the model will extract the true outcome. This probability is
called the model accuracy
In regression tasks, we are often interested in the average
deviation between the outcome of the model and the true
outcome. This deviation is called RMSE
Too General / Too
Simple / Under
fitted
Too Specific / Too
Complex / Over
fitted
A nice solution to
the trade-off
SUPERVISED LEARNING EVALUATION
It is always possible to build an over fitted model. So the quality
of the model on the training set say very little on the capability
of the model to generalize to new observations.
Therefor, never evaluate a model using the training set
Instead:
• Use an independent (randomly selected) test set
• Use cross validation
SUPERVISED LEARNING EVALUATION
RedBlue
17Blue
50Red
Classified As
Actual
Confusion Matrix
SUPERVISED LEARNING EVALUATION
RedBlue
17Blue
50Red
Classified As
Actual
Confusion Matrix
Accuracy (on test set) = (7+5)/(7+5+1+0)
CROSS VALIDATION
Randomly break the training set into k mutually exclusive,
collectively exhaustive sets, of similar size (often k=10).
For i=1,2,…k:
Train a model using all the sets, except for the i-th set.
Evaluate the trained model over the i-th set.
You end up with k evaluation measures. Evaluate the entire
model as the average of these k results.
SUPERVISED LEARNING SUMMARY
• Two sub problems: classification and regression
• Supervised Learning is all about generalizing from a given
training set
• There is an inherent, hard to solve trade-off between
generalization and over specification
• The more complexity you add to your model, the better it
can fit the training set. You may gain an over fitted model
• Therefor, you never evaluate a model on the training set that
was used to induce it
• Instead, use either and independent test set, or cross
validation
SUPERVISED LEARNING SUMMARY
• We also got familiar with 4 SL methods: K-NN, SVM, Decision
trees and Linear regression
AGENDA
• What is Machine Learning
• Typical Machine Learning Tasks
• Supervised Learning
• Unsupervised Learning
• How to Get Started
• Summary
UNSUPERVISED LEARNING
X1 X2 X3 … Xn-2 Xn-1 Xn
x1,1 x2,1 x3,1 … xn-2,1 xn-1,1 xn,1
x1,2 x2,2 x3,2 … xn-2,2 xn-1,2 xn,2
.
.
.
.
.
.
.
.
.
…
…
…
.
.
.
.
.
.
.
.
.
x1,m-1 x2,m-1 x3,m-1 … xn-2,m-1 xn-1,m-1 xn,m-1
x1,m x2,m x3,m … xn-2,m xn-1,m xn,m
Extract interesting patterns from the input set or
Provide an insightful representation of the input space
UNSUPERVISED LEARNING
Unsupervised Learning tasks:
• Cluster Analysis
• Association Rules Mining
• Hidden Markov Models
• Dimensionality Reduction
• Self-Organising Maps
CLUSTER ANALYSIS
Data points that share a
cluster need to be similar
Data points in different
clusters need to be different
Similarity = Low distance Difference = High distance?
CLUSTER ANALYSIS
CLUSTER ANALYSIS
CLUSTER ANALYSIS
CLUSTER ANALYSIS
K-Means:
Initialize: place k cluster centroids on the feature space
Repeat until some stopping criteria are met:
Associate each data point to the closest centroid
Move each centroid to the center of the points that are
associated to it
CLUSTER ANALYSIS
Does distance means similarity?
What distance?
CLUSTER ANALYSIS
Does distance means similarity?
What distance?
For example, let us look at similarity in monthly salary.
Mr. X earns $2,500 a month
Mrs. Y earns $250,000 a month
Mr. Z earns $100,00 a month. Is he more similar (in terms of
salary) to X or to Y?
CLUSTER ANALYSIS
Does distance means similarity?
What distance?
How should we compute a multi-dimensional distance?
Player Name Height Position Age Plays in Goals this
year
Annual
Wages
Country of
Birth
Lionel Andrés
Messi
169 cm Forward 30 Spain 41 M 36 EUR Portugal
Cristiano
Ronaldo
185cm Forward 31 Spain 27 M 17 EUR Argentina
AGENDA
• What is Machine Learning
• Typical Machine Learning Tasks
• Supervised Learning
• Unsupervised Learning
• How to Get Started
• Summary
HOW TO GET STARTED
• Maintaining and manipulating more and more data becomes
more and more affordable
• Machine Learning suggest a very reach set of boxes.
Selecting the right boxes and building a business solution
requires lots of experience
• Training the right models, tuning the parameters, evaluating
performance and implementation all require some level of
expertise but this should not be your first concerns
• The prediction is not in the box
HOW TO GET STARTED
Business Value
Implement
Machine
Learning
Business
Definition
CRISP-DM
HOW TO GET STARTED
A recommended checklist, before you even start:
1. What am trying to achieve, businesswise?
2. What data it requires? Do I have this data? Am I allowed to
use it?
3. What will be the output of a machine learning model?
4. Can my operations use that output? How?
5. What machine learning task am I trying to solve?
6. What are the success criteria?
7. Who will be the ones to run the project?
8. How long will it take? How much will it cost?
AGENDA
• What is Machine Learning
• Typical Machine Learning Tasks
• Supervised Learning
• Unsupervised Learning
• How to Get Started
• Summary
SUMMARY
• Machine learning = designing machines that learn from
experience
• Three typical tasks:
• Supervised Learning
• Unsupervised Learning
• Reinforcement Learning
• Supervised Learning:
• Learning means generalization
• Generalization vs. Specification, Over fitting and Under fitting
• Classification vs. Regression
SUMMARY
• Supervised Learning algorithms:
• K-NN
• SVM
• Decision Trees
• Linear Regression
• More
• Unsupervised Learning
• Cluster analysis: similarity and distance
• Association rules
• Reinforcement Learning
• The big data challenge of Machine Learning
• CRISP-DM
INTRODUCTION TO MACHINE LEARNING

More Related Content

PDF
Dimensionality Reduction
PDF
Lecture 1: What is Machine Learning?
PDF
Introduction to Machine Learning with SciKit-Learn
PPT
Support Vector machine
ODP
NAIVE BAYES CLASSIFIER
PPTX
Logistic Regression | Logistic Regression In Python | Machine Learning Algori...
PPTX
Random forest
PPTX
Support Vector Machines- SVM
Dimensionality Reduction
Lecture 1: What is Machine Learning?
Introduction to Machine Learning with SciKit-Learn
Support Vector machine
NAIVE BAYES CLASSIFIER
Logistic Regression | Logistic Regression In Python | Machine Learning Algori...
Random forest
Support Vector Machines- SVM

What's hot (20)

PPTX
Machine Learning
PPTX
Random forest
PDF
Deep learning
PDF
Introduction to Statistical Machine Learning
PDF
Support Vector Machines for Classification
PDF
Introduction to Machine Learning Classifiers
PDF
K - Nearest neighbor ( KNN )
PDF
Lecture1 introduction to machine learning
PPTX
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
PPT
Machine learning
PPTX
Introduction to Machine Learning
PPTX
Decision tree, softmax regression and ensemble methods in machine learning
PPTX
What Is Machine Learning? | What Is Machine Learning And How Does It Work? | ...
PPT
Machine learning
PDF
Naive Bayes
PDF
ML Basics
PDF
Support Vector Machines ( SVM )
PPTX
Support Vector Machine ppt presentation
PPTX
Machine learning
PDF
Data preprocessing using Machine Learning
Machine Learning
Random forest
Deep learning
Introduction to Statistical Machine Learning
Support Vector Machines for Classification
Introduction to Machine Learning Classifiers
K - Nearest neighbor ( KNN )
Lecture1 introduction to machine learning
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
Machine learning
Introduction to Machine Learning
Decision tree, softmax regression and ensemble methods in machine learning
What Is Machine Learning? | What Is Machine Learning And How Does It Work? | ...
Machine learning
Naive Bayes
ML Basics
Support Vector Machines ( SVM )
Support Vector Machine ppt presentation
Machine learning
Data preprocessing using Machine Learning
Ad

Viewers also liked (20)

PPTX
Agile versioning with Git
PDF
An Introductory course on Digital Transformation
PPTX
Innovatiecafe regie op persoonlijke devices
PDF
Marlabs Capabilities Overview: Telecom
PPTX
Altijd en overal toegang tot onderwijs met Office 365
PDF
Sea power-session 10-empire
PPTX
Opleiding Management in de Zorg Associate Degree: flexibel, op maat en blended
PDF
CEO-008-高效能的領導管理
PPT
Water cycle ppt
PDF
Presentacion gvLOGOS-GEDES
PDF
跨界思考與創新 (慈濟大學)
PDF
Hr 017 社會新鮮人生涯規劃
PPSX
Hadoop Tutorials
PPTX
Hadoop Troubleshooting 101 - Japanese Version
PDF
問題處理與策略規劃技巧 (淡江大學)
PPTX
Ontwerpend leren - effectief persoonlijk leren in de 21e eeuw
PPTX
Introduction to HiveQL
PDF
Marlabs Capabilities Overview: Cyber Security Services
PDF
20160219 devsumi cookpad matsuo
PDF
HBaseCon 2015: HBase at Scale in an Online and High-Demand Environment
Agile versioning with Git
An Introductory course on Digital Transformation
Innovatiecafe regie op persoonlijke devices
Marlabs Capabilities Overview: Telecom
Altijd en overal toegang tot onderwijs met Office 365
Sea power-session 10-empire
Opleiding Management in de Zorg Associate Degree: flexibel, op maat en blended
CEO-008-高效能的領導管理
Water cycle ppt
Presentacion gvLOGOS-GEDES
跨界思考與創新 (慈濟大學)
Hr 017 社會新鮮人生涯規劃
Hadoop Tutorials
Hadoop Troubleshooting 101 - Japanese Version
問題處理與策略規劃技巧 (淡江大學)
Ontwerpend leren - effectief persoonlijk leren in de 21e eeuw
Introduction to HiveQL
Marlabs Capabilities Overview: Cyber Security Services
20160219 devsumi cookpad matsuo
HBaseCon 2015: HBase at Scale in an Online and High-Demand Environment
Ad

Similar to Introduction to Machine Learning (20)

PDF
ml basics ARTIFICIAL INTELLIGENCE, MACHINE LEARNING, TYPES OF MACHINE LEARNIN...
PPTX
Machine Learning_PPT.pptx
PDF
Machine learning Algorithms
PPTX
Machine_Learning.pptx
PPT
Supervised and unsupervised learning
PPTX
AI_06_Machine Learning.pptx
PPTX
3171617_introduction_applied machine learning.pptx
PDF
Machine learning
PPTX
introduction to machine learning
PDF
Computational decision making
PPTX
How Machine Learning Helps Organizations to Work More Efficiently?
PPTX
Introduction to Machine Learning
PPT
lec1.ppt
PPT
Lecture 1
PPTX
Machine learning Method and techniques
PPT
notes as .ppt
PPT
slides
PPT
slides
PPTX
Lecture 09(introduction to machine learning)
PPT
Machine Learning ICS 273A
ml basics ARTIFICIAL INTELLIGENCE, MACHINE LEARNING, TYPES OF MACHINE LEARNIN...
Machine Learning_PPT.pptx
Machine learning Algorithms
Machine_Learning.pptx
Supervised and unsupervised learning
AI_06_Machine Learning.pptx
3171617_introduction_applied machine learning.pptx
Machine learning
introduction to machine learning
Computational decision making
How Machine Learning Helps Organizations to Work More Efficiently?
Introduction to Machine Learning
lec1.ppt
Lecture 1
Machine learning Method and techniques
notes as .ppt
slides
slides
Lecture 09(introduction to machine learning)
Machine Learning ICS 273A

Recently uploaded (20)

PPTX
Moving the Public Sector (Government) to a Digital Adoption
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PPTX
Major-Components-ofNKJNNKNKNKNKronment.pptx
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPT
Chapter 3 METAL JOINING.pptnnnnnnnnnnnnn
PPT
Reliability_Chapter_ presentation 1221.5784
PDF
Foundation of Data Science unit number two notes
PPTX
Business Acumen Training GuidePresentation.pptx
PPTX
Introduction to Knowledge Engineering Part 1
PDF
.pdf is not working space design for the following data for the following dat...
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
PPTX
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PDF
Mega Projects Data Mega Projects Data
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PPTX
IB Computer Science - Internal Assessment.pptx
PDF
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
Moving the Public Sector (Government) to a Digital Adoption
Business Ppt On Nestle.pptx huunnnhhgfvu
Major-Components-ofNKJNNKNKNKNKronment.pptx
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
Chapter 3 METAL JOINING.pptnnnnnnnnnnnnn
Reliability_Chapter_ presentation 1221.5784
Foundation of Data Science unit number two notes
Business Acumen Training GuidePresentation.pptx
Introduction to Knowledge Engineering Part 1
.pdf is not working space design for the following data for the following dat...
Fluorescence-microscope_Botany_detailed content
STUDY DESIGN details- Lt Col Maksud (21).pptx
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Mega Projects Data Mega Projects Data
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
IB Computer Science - Internal Assessment.pptx
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf

Introduction to Machine Learning

  • 2. CHILD LEARNING Child:Daddy what is danger? Dad: The possibility of suffering harm or injury. Child:Daddy what is an injury? Dad: An instance of being injured. Child:Daddy what is an instance? Dad: An example or single occurrence of something. Child:Daddy does it bother you that I’m asking so many questions? Dad: Not at all, if you don't ask you will never know.
  • 3. CHILD LEARNING Dad: Let me give you some examples…
  • 4. CHILD LEARNING Child:Now I understand, everything is dangerous Dad: No, there are things that aren't dangerous
  • 6. CHILD LEARNING And there is the most natural mode of learning Action Reaction Lesson Touching hot stove aching hand Do not touch again Playing with toys Fun Continue playing Running in to the road Screaming parent Don’t run to roads Running in the house Fun Run in the house Eating chocolate Fun Search for chocolate Eating too much chocolate Stomach ache Don’t eat too much Saying bla bla No Reaction Try variations Saying daddy Overexcited parents Do that again
  • 7. SO, HOW CHILDREN LEARN? 1. From explanation 2. From examples 3. Reinforcement Learning
  • 8. SO, HOW CHILDREN LEARN? 1. From explanation 2. From examples 3. Reinforcement Learning
  • 10. AGENDA • What is Machine Learning • Typical Machine Learning Tasks • Supervised Learning • Unsupervised Learning • How to Get Started • Summary
  • 11. AGENDA • What is Machine Learning • Typical Machine Learning Tasks • Supervised Learning • Unsupervised Learning • How to Get Started • Summary
  • 12. WHAT IS MACHINE LEARNING? We say that a computer program is learning a task, if its performance on that task is improving as more experience is processed
  • 13. WHAT IS MACHINE LEARNING? Machine Learning Statistics Databases & Big Data Decision Theory Artificial Intelligence Optimization
  • 14. WHAT IS MACHINE LEARNING? Machine Learning Statistics Databases & Big Data Decision Theory Artificial Intelligence Optimization Data Science
  • 15. AGENDA • What is Machine Learning • Typical Machine Learning Tasks • Supervised Learning • Unsupervised Learning • How to Get Started • Summary
  • 16. TYPICAL MACHINE LEARNING TASKS No two Machine Learning tasks are identical. Yet, we often use the following categories: • Supervised Learning • Unsupervised Learning • Reinforcement Learning
  • 17. SUPERVISED LEARNING Estimate or Predict an unknown result, given explicit values of some explaining features. The learning takes place as history of observations, for which both the explaining features and the results are known. Experience = supervised examples (exactly as in inferring what is dangerous from examples) We call the dataset that describe the experience training set
  • 18. SUPERVISED LEARNING Estimate or Predict an unknown result, given explicit values of some explaining features. We call the dataset that describe the experience training set When the unknown result is numeric, we call the task Regression When the unknown result is categorical, we call the task Classification
  • 19. SUPERVISED LEARNING Example 1: What will be the annual spent of a new customer, given a set of explaining features (e.g., demographics, first purchases, first deposit etc.)? Task qualifications: Prediction, Regression Training set: a file, in which each row represents a customer. For each such customer we will extract the explaining features, at the prediction point, as well as the annual spent (a year later).
  • 20. SUPERVISED LEARNING Example 2: What is the activity currently performed by a user who is wearing a smart watch with inertial sensors? Task qualifications: Assessment, Classification Input: A set of sensor-based signals, along with an annotation of the activity during each signal. Requires a significant amount of pre-processing in order to produce the training set.
  • 22. UNSUPERVISED LEARNING Given a specific set of records, described by a given set of features, either: 1. Extract interesting patterns that appear in the data 2. Provide insightful representation of the distribution of the data Experience: the more records we have, the more significant are the patterns that we can extract, or more accurate is the representation
  • 23. UNSUPERVISED LEARNING Example: Market Segmentation Input data: Customers’ descriptions Objective: Provide an insightful representation of the market (what types of customers are there?) Also known as cluster analysis
  • 24. REINFORCEMENT LEARNING Learning how to best react to situation through trial and error. Simple Example: Multiple A/B testing More Typical: Robot Navigation Designing a RL system requires solving two difficult challenges: • The exploration – exploitation dilemma • Attributing delayed rewards
  • 25. UNSTRUCTURED INPUTS The input data often come in an unstructured form, such as: • Free text • Speech • Images • Video • Sensors • Networks
  • 26. AGENDA • What is Machine Learning • Typical Machine Learning Tasks • Supervised Learning • Unsupervised Learning • How to Get Started • Summary
  • 27. SUPERVISED LEARNING X1 X2 X3 … Xn-2 Xn-1 Xn Y x1,1 x2,1 x3,1 … xn-2,1 xn-1,1 xn,1 y1 x1,2 x2,2 x3,2 … xn-2,2 xn-1,2 xn,2 y2 . . . . . . . . . … … … . . . . . . . . . x1,m-1 x2,m-1 x3,m-1 … xn-2,m-1 xn-1,m-1 xn,m-1 ym-1 x1,m x2,m x3,m … xn-2,m xn-1,m xn,m ym 𝑌 = 𝑓 𝑋1, 𝑋2, … , 𝑋 𝑛
  • 28. LEARNING THE CONCEPT OF A BIRD An alien asks you: “What is a bird?” You can try and define a bird, but the alien does not understand Why don’t you give an example…
  • 29. LEARNING THE CONCEPT OF A BIRD Is Bird?Can Fly ?ColorExample # YesYesBlack1 What do you say about the following classification model: “If Color = Black and Can_Fly = Yes then Bird Else Not_Bird”?
  • 30. LEARNING THE CONCEPT OF A BIRD Is Bird?Can Fly ?ColorExample # YesYesBlack1 YesYesGrey2 What do you say about the following classification model: “If Can_Fly = Yes then Bird Else Not_Bird”?
  • 31. LEARNING THE CONCEPT OF A BIRD Is Bird?Can Fly ?ColorExample # YesYesBlack1 YesYesGrey2 NoYesBlack3 Supervised Learning means generalizing from given observations.
  • 32. GENERALIZATION VS. SPECIFICATION • A general concept is built based on the explaining features. The right set of explaining features is crucial for learning • Being over specific means memorizing and not learning • Being too general means being too coarse and missing some of the details • Finding the sweet spot between generalization and specificity is hard
  • 33. GENERALIZATION VS. SPECIFICATION Let us find a function that estimates Y=f(X)
  • 35. Too General / Too Simple / Under fitted Too Specific / Too Complex / Over fitted A nice solution to the trade-off
  • 36. OVER FITTING & UNDER FITTING • We search for • We know that in addition to the functional dependency (called bias), the actual Y values are also affected by noise (called variance) • We want the model to learn the bias, but not to be affected by the variance. • A model that is too simple to learn the bias is called under fitted • A model that is overly complex that it adapts itself to the variance is called over fitted 𝑌 = 𝑓 𝑋1, 𝑋2, … , 𝑋 𝑛 The more complexity you add to the model, you can always better fit it to the training observations. This is not always a good practice!
  • 37. A PARTIAL LIST OF SUPERVISED LEARNING METHODS • K- Nearest Neighbor • SVM (Optimal Margin Linear Separation) • Decision Trees • Naïve Bayes • Linear Regression • Logistic Regression • (Deep) Neural Networks
  • 38. A PARTIAL LIST OF SUPERVISED LEARNING METHODS • K- Nearest Neighbor • SVM (Optimal Margin Linear Separation) • Decision Trees • Naïve Bayes • Linear Regression • Logistic Regression • (Deep) Neural Networks
  • 39. K-NN Recipients EmailLength Given a new observation, find the K closest available observations and: • In regression, use the average result of these K observations • In Classification, use voting amongst these K observations
  • 40. K-NN Recipients EmailLength K=3 Few concerns: • What should be k? • Which distance measure should be used? • Computation
  • 41. LINEAR SEPERATORS How would you classify this data? X1 X2
  • 42. LINEAR SEPERATORS How would you classify this data? X1 X2
  • 44. LINEAR SEPERATORS X1 X2 In SVM we search for the linear separator that has the maximal margin. Using a mathematical trick, called The Kernel Trick, SVMs can also find non-linear separators
  • 45. DECISION TREES Example: classify new customers into one of two groups: Standard and VIP. Training set: a list of customers that were once new, along with an annotation that reflect if these customers should have been identified as VIP (this annotation is made only after some time). Let us say that we have 1,000 VIPs and 4,000 Standard new customers
  • 46. DECISION TREES Let us say that we have 1,000 VIPs and 4,000 Standard new customers 1,000 V 4,000 S
  • 47. DECISION TREES The population is a mix of different types. What if we could find splitting criterion that will create two (or more), more pure sub populations 1,000 V 4,000 S
  • 48. DECISION TREES The population is a mix of different types. What if we could find splitting criterion that will create two (or more), more pure sub populations 1,000 V 4,000 S Self Employed 600 V 800 S Employees 400 V 3,200 S
  • 49. DECISION TREES Now, we can take each sub-population and split it recursively, until some stopping criteria are met. 1,000 V 4,000 S Self Employed 600 V 800 S Employees 400 V 3,200 S
  • 50. DECISION TREES • Decision trees are a result of recursive splitting mechanism • Each split is chosen as to maximize the purity of the sub populations that results from the split • Few ways to model node purity. Often the concept of minimal entropy (or a variation of minimal entropy) is used • Each split is made according to the values of one of the explaining features
  • 51. LINEAR REGRESSION 0 50 100 150 200 250 300 350 400 450 0 1000 2000 3000 HousePrice($1000s) Square Feet
  • 52. LINEAR REGRESSION 0 50 100 150 200 250 300 350 400 450 0 1000 2000 3000 HousePrice($1000s) Square Feet
  • 53. SUPERVISED LEARNING EVALUATION Since Supervised Learning is all about generalization, a good model is a model that can be applied successfully to new observations In classification tasks, we are often interested in the probability that the model will extract the true outcome. This probability is called the model accuracy In regression tasks, we are often interested in the average deviation between the outcome of the model and the true outcome. This deviation is called RMSE
  • 54. Too General / Too Simple / Under fitted Too Specific / Too Complex / Over fitted A nice solution to the trade-off
  • 55. SUPERVISED LEARNING EVALUATION It is always possible to build an over fitted model. So the quality of the model on the training set say very little on the capability of the model to generalize to new observations. Therefor, never evaluate a model using the training set Instead: • Use an independent (randomly selected) test set • Use cross validation
  • 57. SUPERVISED LEARNING EVALUATION RedBlue 17Blue 50Red Classified As Actual Confusion Matrix Accuracy (on test set) = (7+5)/(7+5+1+0)
  • 58. CROSS VALIDATION Randomly break the training set into k mutually exclusive, collectively exhaustive sets, of similar size (often k=10). For i=1,2,…k: Train a model using all the sets, except for the i-th set. Evaluate the trained model over the i-th set. You end up with k evaluation measures. Evaluate the entire model as the average of these k results.
  • 59. SUPERVISED LEARNING SUMMARY • Two sub problems: classification and regression • Supervised Learning is all about generalizing from a given training set • There is an inherent, hard to solve trade-off between generalization and over specification • The more complexity you add to your model, the better it can fit the training set. You may gain an over fitted model • Therefor, you never evaluate a model on the training set that was used to induce it • Instead, use either and independent test set, or cross validation
  • 60. SUPERVISED LEARNING SUMMARY • We also got familiar with 4 SL methods: K-NN, SVM, Decision trees and Linear regression
  • 61. AGENDA • What is Machine Learning • Typical Machine Learning Tasks • Supervised Learning • Unsupervised Learning • How to Get Started • Summary
  • 62. UNSUPERVISED LEARNING X1 X2 X3 … Xn-2 Xn-1 Xn x1,1 x2,1 x3,1 … xn-2,1 xn-1,1 xn,1 x1,2 x2,2 x3,2 … xn-2,2 xn-1,2 xn,2 . . . . . . . . . … … … . . . . . . . . . x1,m-1 x2,m-1 x3,m-1 … xn-2,m-1 xn-1,m-1 xn,m-1 x1,m x2,m x3,m … xn-2,m xn-1,m xn,m Extract interesting patterns from the input set or Provide an insightful representation of the input space
  • 63. UNSUPERVISED LEARNING Unsupervised Learning tasks: • Cluster Analysis • Association Rules Mining • Hidden Markov Models • Dimensionality Reduction • Self-Organising Maps
  • 64. CLUSTER ANALYSIS Data points that share a cluster need to be similar Data points in different clusters need to be different Similarity = Low distance Difference = High distance?
  • 68. CLUSTER ANALYSIS K-Means: Initialize: place k cluster centroids on the feature space Repeat until some stopping criteria are met: Associate each data point to the closest centroid Move each centroid to the center of the points that are associated to it
  • 69. CLUSTER ANALYSIS Does distance means similarity? What distance?
  • 70. CLUSTER ANALYSIS Does distance means similarity? What distance? For example, let us look at similarity in monthly salary. Mr. X earns $2,500 a month Mrs. Y earns $250,000 a month Mr. Z earns $100,00 a month. Is he more similar (in terms of salary) to X or to Y?
  • 71. CLUSTER ANALYSIS Does distance means similarity? What distance? How should we compute a multi-dimensional distance? Player Name Height Position Age Plays in Goals this year Annual Wages Country of Birth Lionel Andrés Messi 169 cm Forward 30 Spain 41 M 36 EUR Portugal Cristiano Ronaldo 185cm Forward 31 Spain 27 M 17 EUR Argentina
  • 72. AGENDA • What is Machine Learning • Typical Machine Learning Tasks • Supervised Learning • Unsupervised Learning • How to Get Started • Summary
  • 73. HOW TO GET STARTED • Maintaining and manipulating more and more data becomes more and more affordable • Machine Learning suggest a very reach set of boxes. Selecting the right boxes and building a business solution requires lots of experience • Training the right models, tuning the parameters, evaluating performance and implementation all require some level of expertise but this should not be your first concerns • The prediction is not in the box
  • 74. HOW TO GET STARTED Business Value Implement Machine Learning Business Definition
  • 76. HOW TO GET STARTED A recommended checklist, before you even start: 1. What am trying to achieve, businesswise? 2. What data it requires? Do I have this data? Am I allowed to use it? 3. What will be the output of a machine learning model? 4. Can my operations use that output? How? 5. What machine learning task am I trying to solve? 6. What are the success criteria? 7. Who will be the ones to run the project? 8. How long will it take? How much will it cost?
  • 77. AGENDA • What is Machine Learning • Typical Machine Learning Tasks • Supervised Learning • Unsupervised Learning • How to Get Started • Summary
  • 78. SUMMARY • Machine learning = designing machines that learn from experience • Three typical tasks: • Supervised Learning • Unsupervised Learning • Reinforcement Learning • Supervised Learning: • Learning means generalization • Generalization vs. Specification, Over fitting and Under fitting • Classification vs. Regression
  • 79. SUMMARY • Supervised Learning algorithms: • K-NN • SVM • Decision Trees • Linear Regression • More • Unsupervised Learning • Cluster analysis: similarity and distance • Association rules • Reinforcement Learning • The big data challenge of Machine Learning • CRISP-DM