3. IML-Module1
Overview
1. About this course
1. What is machine learning
1. Categories of machine learning
1. Notation
1. Approaching a machine learning application
1. Different machine learning approaches
and motivations
3
5. IML-Module1
Overview
1. About this course
1. What is machine learning
1. Categories of machine learning
1. Notation
1. Approaching a machine learning application
1. Different machine learning approaches
and motivations
5
6. History of Machine Learning
• ML is making our day to day life easy from self-driving
cars to Amazon virtual assistant "Alexa".
• Below some milestones are given which have occurred in
the history of machine learning:
6
Image source: https://www.javatpoint.com/machine-learning
10. [...] machine learning is a subcategory within the field of computer
science, which allows you to implement artificial intelligence. So it’s
kind of a mechanism to get you to artificial intelligence.
-- Rana el Kaliouby, CEO at
Affectiva
Image Source: https://fortune.com/2019/03/08/rana-el-kaliouby-ceo-
affectiva/
IML-Module1
10
11. 1
(This is likely not an original quote but a paraphrased version of Samuel’s
sentence ”Pro- gramming computers to learn from experience should
eventually eliminate the need for much of this detailed programming
e↵ort.”)
Arthur L Samuel. “Some studies in machine learning using the game of checkers”. In: IBM
Journal of research and development 3.3 (1959), pp. 210–229.
“Machine learning is the field of study that gives computers the ability to learn
without being explicitly programmed”
— Arthur L. Samuel, AI pioneer, 1959
Image Source: https://history-computer.com/ModernComputer/thinkers/images/Arthur-
Samuel1.jpg
IML-Module1
11
13. Machine learning is the field of study that gives computers the
ability to learn without being explicitly programmed
— Arthur Samuel (1959)
Inputs
Inputs (observations)
Program
Programmer Computer Outputs
Outputs
Computer Program
IML-Module1
13
14. • We will not only use the machines for their
intelligence, we will also collaborate with them in
ways that we cannot even imagine.
-- Fei Fei Li, Director of Stanford's artificial intelligence lab
Image Source: https://en.wikipedia.org/wiki/Fei-
Fei_Li#/ media/File:Fei-
Fei_Li_at_AI_for_Good_2017.jpg
IML-Module1
14
15. “A computer program is said to learn from experience E with
respect to some class of tasks T and performance measure P
, if its performance at tasks in T , as measured by P , improves
with experience E.”
— Tom Mitchell, Professor at Carnegie Mellon
University
2
Tom M Mitchell et al. “Machine learning. pp. 870–
877.
1997”.
In: Burr Ridge, IL: McGraw Hill 45.37 (1997),
IML-Module1
15
16. “A computer program is said to learn from experience E
with respect to some class of tasks T and performance
measure P , if its performance at tasks in T , as measured
by P , improves with experience E.”
— Tom Mitchell, Professor at Carnegie Mellon University
16
17. • Machine Learning is said as a subset of artificial
intelligence that is mainly concerned with the
development of algorithms which allow a computer to
learn from the data and past experiences on their own.
• The term machine learning was first introduced by Arthur
Samuel in 1959. We can define it in a summarized way as:
Machine learning enables a machine to automatically learn from
data, improve performance from experiences, and predict things
without being explicitly programmed.
17
18. a
• Task T: classifying handwritten digits from images
• Performance measure P : percentage of digits
classified correctly
• Training experience E: dataset of digits given
classifications, e.g., MNIST
IML-Module1
Handwriting Recognition Example:
18
19. IML-Module1
Some Applications of Machine Learning:
• Email spam detection
• Face detection and matching (e.g., iPhone X, Windows laptops, etc.)
• Web search (e.g., DuckDuckGo, Bing, Baidu, Google)
• Sports predictions
• Post office (e.g., sorting letters by zip codes)
• ATMs (e.g., reading checks)
• Credit card fraud
19
21. IML-Module1
Overview
1. About this course
1. What is machine learning
1. Categories of machine learning
1. Notation
1. Approaching a machine learning application
1. Different machine learning approaches
and motivations
21
22. Categories of Machine Learning
Labeled data
Direct
feedback
Predict outcome/future
Supervised Learning
IML-Module1
22
24. Types of classification
• The algorithm which implements the classification on a dataset
is known as a classifier. There are two types of Classifications:
• Binary Classifier: If the classification problem has only two
possible outcomes, then it is called as Binary Classifier.
Examples: YES or NO, MALE or FEMALE, SPAM or NOT SPAM,
CAT or DOG, etc.
• Multi-class Classifier: If a classification problem has more than
two outcomes, then it is called as Multi-class Classifier.
Example: Classifications of types of crops, Classification of
types of music.
24
26. Categories of Machine Learning
Labeled data
Direct
feedback
Predict outcome/future
No
labels/targets
No feedback
Find hidden structure in data
Unsupervised Learning
IML-Module1
Supervised Learning
26
29. Categories of Machine Learning
Labeled data
Direct
feedback
Predict outcome/future
No
labels/targets
No feedback
Find hidden structure in data
Decision
process
Reward system
Learn series of actions
Reinforcement Learning
IML-Module1
Unsupervised Learning
Supervised Learning
29
31. Ex: Emergence of Locomotion Behaviours in
Rich Environments
• A new paper from Google’s AI subsidiary DeepMind titled
“Emergence of Locomotion Behaviours in Rich Environments.”
• The research explores how reinforcement learning (or RL) can
be used to teach a computer to navigate unfamiliar and complex
environments.
• It’s the sort of fundamental AI research that we’re now testing in
virtual worlds, but that will one day help program robots that can
navigate the stairs in your house.
31
34. IML-Module1
Lecture 1 Overview
1. About this course
1. What is machine learning
1. Categories of machine learning
1. Notation
1. Approaching a machine learning application
1. Different machine learning approaches
and motivations
34
35. Supervised Learning Workflow
-- Overview
Machine
Learning
Algorithm
IML-Module1
New Data Predictive
Model
Labels
35
Prediction
Training Data
36. Supervised Learning Notation
Unknown function:
Hypothesis:
h : ℝm → h : ℝm →
f(x) = y
h(x) = y
Regressio
n
IML-Module1
Classification
Training set: 𝒟 = {⟨x[i], y[i]⟩, i = 1,… , n},
36
39. Data Representation
Feature vector
X =
xT
1
xT
2
⋮
xT
n
x =
x
1
x
2
⋮
xm
X =
x[1]
1 x[1]
2 x[1]
m
x[2]
1 x[2]
x[2]
m
x[n]
1 x[n]
2
⋯
2 ⋯
⋮ ⋮ ⋱ ⋮
⋯ x[n]
m
IML-Module1
39
40. Notation & Conventions used in this book
• Iris Dataset: 150 Iris flowers
• Different Species: Setosa, Versicolor & Virginica
• Each row represents each flower species
• Each col represents flower measurements in Cm (Features in ML)
40
41. Notation & Conventions used in this book
Features(attributes,
measurements, dimensions)
Class Labels(targets)
m =
n =
IML-Module1
41
43. IML-Module1
ML Terminology (Part 1)
Training example: A row in the table representing the dataset.
Synonymous to an observation, training record, training instance,
training sample (in some contexts, sample refers to a collection of
training examples)
▪
▪ Feature: a column in the table representing the dataset.
Synonymous to predictor, variable, input, attribute,
covariate.
▪ Targets: What we want to predict. Synonymous to
outcome, output, ground truth, response variable,
dependent variable, (class) label (in classification).
▪ Output / prediction: use this to distinguish from targets;
here, means output from the model.
43
44. Hypothesis Space
Entire hypothesis space
IML-Module1
Hypothesis space
a particular learning
algorithm category
has access to
Hypothesis space
a particular learning
algorithm can sample
Particular hypothesis
(i.e., a model/classifier)
44
45. IML-Module1
Lecture Overview
1. About this course
1. What is machine learning
1. Categories of machine learning
1. Notation
1. Approaching a machine learning
application
1. Different machine learning approaches
and motivations 45
46. Supervised Learning Workflow
-- Overview
Machine
Learning
Algorithm
IML-Module1
New
Data
Predictive
Model
Predictio
n
Labels
Training Data
46
48. IML-Module1
5 Steps for Approaching a Machine
Learning Application
1. Define the problem to be solved.
2. Collect (labeled) data.
3. Choose an algorithm class.
4. Choose an optimization metric or measure for learning the model.
5. Choose a metric or measure for evaluating the model.
48
49. IML-Module1
Objective Functions
• Maximize the posterior probabilities (e.g., naive Bayes)
• Maximize a fitness function (genetic programming)
• Maximize the total reward/value function (reinforcement
learning)
• Maximize information gain/minimize child node impurities (CART
decision tree classification)
• Minimize a mean squared error cost (or loss) function (CART,
decision tree regression, linear regression, adaptive linear neurons,
...)
• Maximize log-likelihood or minimize cross-entropy loss (or cost) function
• Minimize hinge loss (support vector machine)
49
51. IML-Module1
ML Terminology (Part 2)
• Loss function: Often used synonymously with cost
function; sometimes also called error function.
• In some contexts the loss for a single data point, whereas
the cost function refers to the overall (average or summed)
loss over the entire dataset.
• Sometimes also called empirical risk.
51
53. IML-Module1
Different Motivations for Studying
Machine Learning
• Engineers: Real world problem solving
• Mathematicians, computer scientists, and statisticians:
• Neuroscientists:
53
54. Machine Learning, AI, and Deep Learning
Machine Learning
Deep Learning
AI
A non-biological
system that is
intelligent through
rules
Algorithms that parameterize multilayer
neural networks that then learn
representations of data with multiple layers
of abstraction
Algorithms that learn
models/representations/
rules automatically
from data/examples
IML-Module1
54
55. Image by Jake VanderPlas; Source:
https://speakerdeck.com/jakevdp/the-state-of-the-stack-scipy-2015-keynote?slide=8)
IML-Module1
55
56. IML-Module1
▪ Hypothesis: A hypothesis is a certain function that we believe (or hope)
is similar to the true function, the target function that we want to model.
▪ Model: In the machine learning field, the terms hypothesis and model are
often used interchangeably. In other sciences, they can have different
meanings.
▪ Learning algorithm: Again, our goal is to find or approximate the target
function, and the learning algorithm is a set of instructions that tries to
model the target function using our training dataset. A learning algorithm
comes with a hypothesis space, the set of possible hypotheses it
explores to model the unknown target function by formulating the final
hypothesis.
▪ Classifier: A classifier is a special case of a hypothesis (nowadays, often
learned by a machine learning algorithm). A classifier is a hypothesis or
discrete-valued function that is used to assign (categorical) class labels to
particular data points
ML Terminology (Part 3)
56
58. Installation Of Python
1. Go to https://www.python.org/
2. Install latest version for your OS. Now latest is 3.11.2
3. Go to Command prompt : type Python-will get Python
information(Version)
4. For installation of packages use command:
pip install PackageName
5. For upgrading packages use:
pip install PackageName –upgrade
6. A highly recommended alternative python distribution for scientific
computing is Anaconda by Continuum Analytics.
7. Anaconda is free: https://docs.anaconda.com/anaconda/install/windows/
8. Python packages can be installed by Anaconda as:
conda install PackageName
9. Package can be updated : conda update PackageName
58
59. Packages for scientific computing, data
science and machine learning
• Make sure that version numbers of installed packages are equal
to greater than these below mentioned version numbers to
ensure that the code examples run correctly.
• NumPy 1.17.4
• SciPy 1.3.1
• Pandas 0.25.3
• Matplotlib 3.1.0
• SciKit-Learn 0.22.0
59