0% found this document useful (0 votes)
5 views

1-PAC - Learning Framework - Example-20-12-2024

The document provides an overview of machine learning, defining it as the ability of machines to improve their performance on tasks through experience. It discusses the differences between human learning and machine learning, outlines various types of machine learning including supervised, unsupervised, and reinforcement learning, and highlights the importance of well-defined learning problems. Additionally, it addresses challenges in machine learning such as the need for quality data and computational power.

Uploaded by

v33261174
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

1-PAC - Learning Framework - Example-20-12-2024

The document provides an overview of machine learning, defining it as the ability of machines to improve their performance on tasks through experience. It discusses the differences between human learning and machine learning, outlines various types of machine learning including supervised, unsupervised, and reinforcement learning, and highlights the importance of well-defined learning problems. Additionally, it addresses challenges in machine learning such as the need for quality data and computational power.

Uploaded by

v33261174
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 75

B.

Tech (Information Technology)


BITE 410L – Machine Learning
Module -1 Introduction

Dr.T.Ramkumar
Professor
SCORE
[email protected]

1
What is Learning ? - From a Human Perspective

 Learning - It is the ability to improve one’s behaviour with


experience
 With more learning, task can be performed more efficiently

 Human Learning happens in the following ways :


 Either somebody who is an expert in the subject directly
teaches us
 We build our own notion indirectly based on what we
have learnt from the expert in the past
 We do it ourselves, may be after multiple attempts, some
being unsucessful
School of Information Technology & Engineering
What is Learning ?

 “Learning denotes changes in a system that ... enable a


system to do the same task … more efficiently the next
time.” - Herbert Simon
 “Learning is constructing or modifying representations of
what is being experienced.” - Ryszard Michalski
 “Learning is making useful changes in our minds.” -
Marvin Minsky

School of Information Technology & Engineering 3


What is Machine Learning ?

• Before answering the question ‘What is machine


learning?’ more fundamental questions that peep into
one’s mind are :

Q1 : Do machines really learn?


Q2 : If so, how do they learn?
Q3 : Which problem can we consider as a well-posed learning
problem? What are the important components that are
required to well-define a learning problem ?

School of Information Technology & Engineering


Q1. Do machines really learn?

• A machine can be considered to learn if it is able to gather


experience by doing a certain task and improve its
performance in doing the similar tasks in the future
• When we talk about past experience, it means past data
related to the task. This data is an input to the machine
from some source.
• Formalize the definition of Machine Learning will itself
address the question

School of Information Technology & Engineering


Q2.How do machines learn?

• The basic machine learning process can be divided into


three parts.

• Data input : Past data or information is utilized as a


basis for future decision-making
• Abstraction : The input data is represented in a
summarized way
• Generalization : The abstracted representation is
generalized to form a framework for making
decisions

School of Information Technology & Engineering


Q2.How do machines learn?

School of Information Technology & Engineering


Q3. Which problems are of Well-Posed Learning
nature ?
• Checkers Learning Problem
• Task ‘T’ – Playing Checkers
• Performance measure ‘P’ - Percent of games won against opponents
• Training experience ‘E’ - Playing practice games against itself

• Handwriting recognition learning problem


• Task ‘T’ – Recognizing and classifying hand-written words within images
• Performance measure ‘P’ : Percentage of words correctly classified
• Training experience ‘E’: A database of handwritten words with given
classifications

School of Information Technology & Engineering


Q3. Which problems are of Well-Posed Learning
nature ?

• Robot Driving Learning Problem

• Task ‘T’ – Driving on public four-lane highways using vision


sensors

• Performance measure ‘P’: average distance traveled before an


error (as judged by human overseer)

• Training experience ‘E’: a sequence of images and steering


commands recorded while observing a human drive

School of Information Technology & Engineering


Why “Machine Learning?”
10

• There is no need to “learn” to calculate payroll

• Learning is used when:

 Human expertise does not exist (navigating on Mars),


 Humans are unable to explain their expertise (speech recognition)
 Solution changes in time (routing on a computer network)
 Solution needs to be adapted to particular cases (user biometrics)

School of Information Technology & Engineering


How Machine Learning Solution differs from
Programmatic Solution ?
• Conventional Programming : After understanding the problem, detailed
design of the program such as a flow chart or algorithm can be created
and converted into program using suitable programming languages

• This approach could be difficult for many real-world problems such as


puzzles , games, complex image recognition applications

• Initially, expert systems have been developed by forming if-then-rules by


the expert knowledge for solving complex problems (Eg. Intelligent
Medical Diagnosis system : MYCIN)

School of Information Technology & Engineering


Traditional Programming Vs. Machine Learning

School of Information Technology & Engineering


Machine Learning Definition

• Machine Learning explores algorithms that learn from data, and build
models from data
• Machine learning is programming computers to optimize a performance
criterion using example data or past experience.
• Arthur Samuel, one of the pioneers of artificial intelligence defines
“ Machine Learning is the field of study that gives the computers, an
ability to learn without being explicitly programmed ”
• There are multiple ways to define machine learning. But the one which is
perhaps most relevant, concise and accepted universally is the one stated by
Tom M. Mitchell, Professor of Machine Learning Department, School of
Computer Science, Carnegie Mellon University.
School of Information Technology & Engineering
Machine Learning Definition

• Tom M. Mitchell has defined machine learning as ‘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.’
• Experience ‘E’ can also be called as past data, The task ‘T’ can be a prediction,
classification of data, and the measure of ‘P’ can be increase of accuracy in
prediction
• In general, to have a well defined learning problem, one must identify the three
components :
• The class of tasks
• The measure of performance to be improved
• The source of experience

School of Information Technology & Engineering


Human Learning Vs.Machine Learning

• As human takes decision based on experience, computers can make model


based on the extracted patterns in the input data and arrive decision
• The aim of the Machine Learning is to learn a model from the given data
automatically so that it can predict the unknown data correctly
• The learnt model is equivalent to the human experience

Human Leanring Machine Learning

School of Information Technology & Engineering


Common Machine Learning Use-cases

• No human experts
• industrial/manufacturing control
• mass spectrometer analysis, drug design, astronomic
discovery
• Black-box human expertise
• face/handwriting/speech recognition
• driving a car, flying a plane
• Rapidly changing phenomena
• credit scoring, financial modeling
• diagnosis, fraud detection
• Need for customization/personalization
• personalized news reader
• movie/book recommendation

School of Information Technology & Engineering 16


Related Disciplines or Fields
data
mining control theory

statistics
decision theory
machine
information theory
learning cognitive science
databases
psychological models
evolutionary neuroscience
models

Machine learning is primarily concerned with the


accuracy and effectiveness of the computer system.
School of Information Technology & Engineering 17
AI - Machine Learning - Deep Learning

School of Information Technology & Engineering 18


A Typical Machine Learner

School of Information Technology & Engineering


Creating a Learner - Steps

• Choose the training experience / training data


• Choose the target fucntion / how we would like to
represent the model
• How to choose the target fucntion / Linear or others
• Choose the learning algorithm for the model

School of Information Technology & Engineering


Models in Machine Learning

• A model is a summarized knowledge representation of the raw data.


The model may be in any one of the following form :

• Computational blocks like if/else rules


• Mathematical equations
• Specific data structures like trees or graphs
• Logical groupings of similar observations

• The choice of the model used to solve a specific learning problem is


a human task. The decision related to the choice of the model is
taken based on multiple aspects
School of Information Technology & Engineering
Representation

School of Information Technology & Engineering


Representation

School of Information Technology & Engineering


Representation

School of Information Technology & Engineering


Choice of the Model

• Choice of the Model is based on


• The type of problem to be solved: Whether the problem is
related to forecast or prediction, analysis of trend, understanding
the different segments or groups of objects, etc.
• Nature of the input data: How exhaustive the input data is,
whether the data has no values for many fields, the data types,
etc.
• Domain of the problem: If the problem is in a business critical
domain with a high rate of data input and need for immediate
inference, e.g. fraud detection problem in banking domain.

School of Information Technology & Engineering


Supervised Machine Learning

School of Information Technology & Engineering


Supervised Machine Learning

School of Information Technology & Engineering


Supervised Machine Learning

School of Information Technology & Engineering


Supervised Machine Learning : Classification

School of Information Technology & Engineering


Supervised Machine Learning : Classification

School of Information Technology & Engineering


Supervised Machine Learning : Regression

School of Information Technology & Engineering


Un-supervised Machine Learning

School of Information Technology & Engineering


Unsupervised Machine Learning
• In unsupervised learning, there is no labelled
training data to learn from and no prediction to be
made
• The objective is to take a dataset as input and try to
find natural groupings or patterns within the data
elements or records
• Therefore, unsupervised learning is often termed as
descriptive model and the process of unsupervised
learning is referred as pattern discovery or
knowledge discovery
• So, it’s a method of data exploration – a way of
looking for patterns or structure in the data that are of
interest
School of Information Technology & Engineering
Unsupervised Machine Learning Techniques

• Mining Association
• Rule based approach for revealing interesting
relationships about data poits
• Discover correlations and co-occurrences within the data
and the different connections between data objects
• Clustering
• Technique for exploring raw, unlabeled data and breaking
it down into groups (or clusters) based on similarities or
differences
• Also used as a data pre-processing technique for finding
outliers

School of Information Technology & Engineering


Unsupervised Machine Learning Techniques

• Dimensionality reduction
• Extracts important features from the dataset, reducing the
number of irrelevant or random features present
• Without compromising the integrity of the properties in
the original data.
• Uses principle component analysis (PCA) to reduce the
number of features

School of Information Technology & Engineering


Unsupervised Learning

School of Information Technology & Engineering


Clustering
• Clustering is the main type of unsupervised learning. It intends to group
or organize similar objects together.
• Objects belonging to the same cluster are quite similar to each other
while objects belonging to different clusters are quite dissimilar
• The objective of clustering to discover the intrinsic grouping of
unlabeled data and form clusters
• Different measures of similarity can be applied for clustering.
• One of the most commonly adopted similarity measure is distance
• Two data items are considered as a part of the same cluster if the
distance between them is less. In the same way, if the distance between
the data items is high, the items do not generally belong to the same
cluster

School of Information Technology & Engineering


Clustering

School of Information Technology & Engineering


• One more variant of unsupervised learning is association analysis
• Helpful in boosting the sales pipeline
• Used to identify the items which are being purchased together
• From past transaction data in a grocery store, it may be observed that
most of the customers who have bought item A, have also bought item
B and item C or at least one of them
• Identify the casual relationship exist in customer buying behavior
• Using Objective measures such as support, confidence, lift and others

School of Information Technology & Engineering


Association Analysis

School of Information Technology & Engineering


1

Reinforcement Learning

Reinforcement Learning is a machine learning approach


where an agent learns to make decisions by interacting
with an environment, receiving feedback in the form of
rewards or penalties. The goal is for the agent to learn a
strategy that maximizes cumulative rewards over time.

School of Information Technology & Engineering


Reinforcement Learning

School of Information Technology & Engineering


3

Comparison with Supervised and Unsupervised

• Objective
• Training Data
• Feedback Mechanism
• Use cases

School of Information Technology & Engineering


4

• Reinforcement Learning: Focuses on training agents to make sequences


of decisions in an environment to maximize a cumulative reward. The
agent learns by interacting with the environment and receiving feedback in
the form of rewards or penalties.
• Supervised Learning: Involves training a model on a labeled dataset,
where the algorithm learns the mapping between input features and
corresponding target labels. The goal is to make accurate predictions on
new, unseen data.
• Unsupervised Learning: Deals with unlabeled data and aims to discover
hidden patterns, relationships, or structures within the data. It includes
tasks like clustering, dimensionality reduction, and density estimation.

School of Information Technology & Engineering


5

Training Data

• Reinforcement Learning : The agent learns from trial and


error, exploring different actions and observing the
consequences (rewards or penalties) of those actions.
• Supervised Learning: Requires a labeled dataset where
each example is paired with a corresponding target label.
The model learns to generalize from the provided examples
to make predictions on new, unseen data.
• Unsupervised Learning: Works with unlabeled data, and
the algorithms try to find inherent structures or patterns
within the data without explicit target labels.

School of Information Technology & Engineering


6

Feedback Mechanism

• Reinforcement Learning (RL): Feedback is in the form of


rewards or penalties based on the agent's actions in the
environment. The agent learns to maximize the cumulative
reward over time.
• Supervised Learning: The model receives explicit
feedback in the training data. The goal is to minimize the
difference between predicted and true labels.
• Unsupervised Learning: There is no explicit feedback in
the form of labels. The algorithms aim to discover intrinsic
patterns or relationships within the data.

School of Information Technology & Engineering


7

Use cases

• Reinforcement Learning (RL): Often applied in scenarios


where an agent interacts with a dynamic environment, such
as game playing, robotic control, and autonomous systems.
• Supervised Learning: Commonly used for tasks like image
classification, speech recognition, and regression problems
where there's a clear mapping between inputs and labels.
• Unsupervised Learning: Applied in tasks like clustering,
anomaly detection, and dimensionality reduction, where the
goal is to uncover hidden structures in the data.

School of Information Technology & Engineering


Semi-Supervised Learning
• Semi-supervised learning uses a combination of
supervised and unsupervised learning by applying labeled
and unlabeled data to train a model
• Labeled data provides the model with explicit examples
of what input data corresponds to which labels, allowing
the model to learn to predict it for new data
• Unlabeled data is then used to refine and improve this
model, helping it better understand its overall structure
and distribution, which can lead to more accurate and
generalized predictions when dealing with new, unlabeled
data

School of Information Technology & Engineering


Semi-Supervised Learning

School of Information Technology & Engineering


Semi-Supervised Learning

School of Information Technology & Engineering


Machine Learning - Challenges

• Need a Well-Posed Learning Problem, Not an ill-posed


one

• Need of huge amount of quality data

• High Computation Power

• Complexity of Algorithms

• Overfitting and Underfitting of Machine learning models

School of Information Technology & Engineering


PAC (Probably Approximately Correct) Learning : Problem Setting

Few thoughts/questions
 Is it possible to identify classes of learning problems that are

inherently difficult or easy, independent of the learning


algorithm?
 Can one characterize the number of training examples necessary

or sufficient to assure successful learning?


 Can one characterize the number of mistakes that a learner will

make before learning the target function?


 PAC (Probably Approximately Correct) learning is a theoretical

framework for mathematical analysis of machine learning


algorithms - Provides answer for these question

School of Information Technology & Engineering


PAC (Probably Approximately Correct) Learning

 It was developed by Leslie Valiant in 1984.


 It is part of a field called Computational Learning Theory.
 It defines a mathematical relationship between the number of
training samples, the error rate, and the probability that the
available training data are large enough to attain the desired error
rate.
 Answers the following questions
 "Under what conditions is successful learning possible and
impossible?"
 "Under what conditions is a particular learning algorithm assured
of learning successfully?”

School of Information Technology & Engineering


PAC Learning

 Learner receives samples and must select/output a


generalization function (hypothesis) from a certain class of
possible functions.
 Goal of PAC : With high probability (probably) , the selected
function should have low generalization error (approximately
correct)
 The basic idea behind PAC learning is to quantify the trade-
off between the number of training examples (samples) a
learning algorithm requires and the probability that the
algorithm makes an incorrect prediction on new, unseen data

School of Information Technology & Engineering


Problem setting
Given:
 X refers to the set of all possible instances over which target functions are

defined
 C refers to set of target concepts that our learner might be called upon to

learn.
 Each target concept c in C corresponds to some subset of X, or equivalently to

some boolean-valued function c : X  {0, 1}.


 If x is a positive example of c, then c(x) = 1; if x is a negative example, c(x) =

0.

Determine:
 A hypothesis h in H such that h(x) = c(x) for all x in Training examples for a

Distribution ‘D’ over ‘X’


 A hypothesis h in H such that h(x) = c(x) for all x in instances ‘X’

School of Information Technology & Engineering


Problem setting

 Instances are generated at random from X according to


some probability distribution D
 D may be any distribution , D is stationary ( the
distribution does not change over time)
 Training examples, <x, c(x)>, are generated by drawing
an instance x at random according to D, then presenting x
along with its target value, c(x), to the learner

School of Information Technology & Engineering


School of Information Technology & Engineering 57
The key components of PAC learning

Concept Class (C): This represents the set of all possible


concepts that the learning algorithm is trying to learn. This could
include various patterns, relationships, or decision boundaries
within the data.
Hypothesis Class (H): This is the set of hypotheses that the
learning algorithm can output based on the training data. The
learning process involves selecting a hypothesis from this class
that best fits the training examples.
Sample Complexity (m): It is the minimum number of training
examples needed for the learning algorithm to achieve a high
probability of success. It quantifies the amount of data needed for
the algorithm to generalize well to unseen instances.

School of Information Technology & Engineering


Parameters in PAC learning

 Approximation Error parameter (ε)


• It measures how well the hypothesis approximates the true concept.
• It represents the acceptable level of deviation between the predicted
output of the hypothesis and the true output.
• Gives the upper bound on the error in accuracy
• Accuracy : 1- ε

 Probability of Failure (δ)


• It quantifies the level of confidence that the hypothesis generalizes
well to unseen data.
• Confidence : 1-δ

School of Information Technology & Engineering


PAC Learning

 Since training examples drawn at random, there must be a non-


zero probability, that they will be misleading

 Do not require that learner to be succeeded for every randomly


drawn sequence of training examples - Only require that the
probability of failure to be bounded by constant ‘δ’ that can also
be made arbitarly small.

School of Information Technology & Engineering


Formal Definition

School of Information Technology & Engineering 61


PAC Learning

• With high probability, a PAC learning algorithm find a


hypothesis (i.e.) approximately identical to the hidden
target concept.
Training set

Learning algorithm

Hypothesis
h:x{0,1}

School of Information Technology & Engineering


PAC - Learning Example

63

School of Information Technology & Engineering


64

School of Information Technology & Engineering


65

School of Information Technology & Engineering


Approximately Correct Hypothesis

 A Hypothesis is said to be approximately correct if the error


region is less than or equal to ε

 The probability that the learning algorithm produces the


approximately correct hypothesis will be

School of Information Technology & Engineering


67

School of Information Technology & Engineering


School of Information Technology & Engineering 68
PAC : SAMPLE COMPLEXITY

• A learning algorithm is considered PAC-learnable if, with high


probability (at least 1−δ), it outputs a hypothesis whose
approximation error is within ϵ of the true concept.

• The guarantee is that the algorithm's performance improves as


the sample size increases.

• The sample complexity formula is a central expression in


PAC learning is given by
1 1
𝑚 ≥ ln |𝐻| + ln
𝜀 𝛿

Here |𝐻| is the cardinality of the hypothesis space

School of Information Technology & Engineering


COMPUTATION OF SAMPLE COMPLEXITY :
EXAMPLE

• Suppose you are given with


• Hypothesis class: A finite hypothesis class H with |H| =
1000
• Error tolerance 𝜀 : 𝜀 = 0.05 (5% error tolerance)
• Confidence level 1 − 𝛿 : 𝛿 = 0.01 (99% confidence)
• Find the number of samples required (m) required to
guarantee that the true error of the learned hypothesis
ℎ ∈ 𝐻 is within 𝜀 with confidence at least 1 − 𝛿

School of Information Technology & Engineering


SOLUTION

• We have the PAC formula


1 1
𝑚 ≥ ln |𝐻| + ln
𝜀 𝛿
• Step 1: Compute ln|𝐻|. Here, |𝐻| = 1000.

So, ln(|H|) = ln(1000)


= 2.303 × log10 (1000) ln( 𝑥) = log 𝑒 (𝑥)
= 2.303 × 3 log 𝑒 𝑥 = 2.303 × log10 ( 𝑥)

= 6.909
1 1
• Step 2: Compute ln . Here 𝛿 = 0.01 = ln = ln (100)
𝛿 0.01
= 2.303 × log10 (100)
= 2.303 × 2
= 4.606

School of Information Technology & Engineering


SOLUTION

• Step 3: Compute m
1 1
Using PAC formula, 𝑚 ≥ ln |𝐻| + ln
𝜀 𝛿
1
• So, 𝑚 ≥ × 6.909 + 4.606 = (20) × 11.515
0.05
= 230.3
• As m must be an integer, we have m = 231

School of Information Technology & Engineering


Computing the Number of Hypothesis : Example

• Problem set up:


• Suppose there are two input variables 𝑋1 , 𝑋2 and one
output variable Y
• Further, suppose
• 𝑋1 ∈ {𝐴, 𝐵}(two possible values),
• 𝑋2 ∈ {𝐷, 𝐸, 𝐹}(three possible values) and Y is an binary
output variable ∈ {0, 1}
• The task is to learn hypothesis h that maps 𝑋1 , 𝑋2 to Y.
• The input space X consists of all possible combinations of
values 𝑋1 , 𝑋2 , i.e. it has 6 pairs of values
• 𝑋 = 𝐴, 𝐷 , 𝐴, 𝐸 , 𝐴, 𝐹 , 𝐵, 𝐷 , 𝐵, 𝐸 , 𝐵, 𝐹

School of Information Technology & Engineering


Computing the Number of Hypothesis : Example

• Hypothesis class:
• Since h maps each input pair 𝑋1 , 𝑋2 to a value of Y =
0,1 independently, the total number of hypothesis is
26 = 64
• The 64 hypotheses maps all possible mappings from the
input space to the output space.

School of Information Technology & Engineering


Summary of Module 1

• Machine Learning: How Machines Learn?


• Well-Posed Learning Vs. ILL-Posed Learning
• Taxonomy of Machine Learning
• ML Models & Algorithms
• ML – Use cases
• PAC Learning
• Hypothesis and Sample Complexity in PAC Learning

School of Information Technology & Engineering

You might also like