Session 8- Machine Learning Techniques
Session 8- Machine Learning Techniques
Techniques using
ML
Session 8
1
Learning Outcomes
• In this session, we will learn:
− Problem solving categories
− Overview of Machine Learning
− Types of Machine Learning
− Machine Learning Algorithms
2
Problem Solving
• Broadly, solutions can be categorized into two main
types:
− Algorithmic solutions
− Heuristics solutions
3
Problem Solving - Algorithmic
• Algorithms provide step-by-step procedures that can
guarantee solutions
• Algorithms are characterized by being:
− Predictable and repeatable.
− Clear and precise instructions.
− Efficient for problems with a definitive answer.
• Examples:
− Baking a Cake: Following a recipe step-by-step
ensures that the desired cake is produced.
− Adding Two Numbers: Using arithmetic rules to
find the sum guarantees the correct result.
4
Problem Solving - Heuristics
• Heuristics solutions are derived from experience,
intuition, and trial and error rather than a fixed
sequence of steps.
• They are often used for complex problems where
algorithmic solutions are impractical.
• Heuristics are faster and provide shortcuts for getting
to solutions, though this has the potential to cause
errors.
• Heuristics are characterized by being:
− Flexible and adaptive.
− Based on past experiences and educated
guesses.
− Useful in situations with no clear or single solution.
5
Machine Learning (ML) Problem
Solving
• ML is a subset of Artificial Intelligence (AI)
• In AI, problems are typically tackled using two broad
approaches:
− searching techniques and
− modeling techniques.
• Each approach has its own methodologies, strengths,
and applications.
6
Machine Learning - Searching
Techniques
• Involve applying a process with search conditions to
look for the solution of the problem through a set of
possibilities, where solution is a path from current
state to goal state.
Types of Search Techniques:
• Uninformed Search: These algorithms do not have
additional information about the state space.
Examples include:
− Breadth-First Search (BFS): Explores all nodes
at the present depth level before moving on to
nodes at the next depth level.
− Depth-First Search (DFS): Explores as far as
possible along a branch before backtracking.
7
Machine Learning - Searching
Techniques
• Informed Search (Heuristic Search): These
algorithms use heuristic functions to estimate the cost
of reaching the goal from a given state, guiding the
search more efficiently.
Examples include:
− A*: Combines the cost to reach a node and the
estimated cost to reach the goal from that node
(short path).
− Greedy Best-First Search: Selects the node that
appears to be closest to the goal based on the
heuristic.
8
Machine Learning - Modeling
Techniques
• Involve creating a general model to represent the
natural phenomenon then using either knowledge
based systems or data driven methods such as
machine learning (ML) techniques to estimate or learn
unknown parameters of the model.
9
Machine Learning - Modeling
Techniques
Types of Modeling Techniques:
•Mathematical and Statistical Models: Utilize
mathematical equations and statistical methods to
describe relationships within the data.
Examples include:
− Linear Regression: Models the relationship
between a dependent variable and one or more
independent variables.
− Bayesian Networks: Represent probabilistic
relationships among variables.
10
Machine Learning - Modeling
Techniques
Types of Modeling Techniques:
•Machine Learning Models: Employ algorithms that can
learn from and make predictions on data.
Examples include:
− Neural Networks: Used for tasks such as image
recognition and natural language processing.
− Support Vector Machines (SVM): Used for
classification and regression tasks
11
Machine Learning
• Machine learning (ML) is a field of study that assigns
computers the ability to learn without being explicitly
programmed.
12
Machine Learning
Mitchell's Definition of Learning
13
Machine Learning
15
Machine Learning
16
Machine Learning
• Supervised learning -with teacher
− inputs and correct outputs are provided by the
teacher
− used for making prediction about the future
• Unsupervised learning -with no teacher or helper
− no hint about correct output is given
− used for discovering hidden structures or patterns
in data
• Reinforced learning -with reward or punishment
− an action is evaluated based on feedback from
environment
− used to solve interactive problems
17
Supervised Learning
• Algorithms that learn from labeled data, making
predictions based on input-output examples.
• The learning rule is provided with a set of examples
(the training set) of proper system behavior i.e. an
input to the system and the corresponding correct
(target) output.
• As the inputs are applied to the system, the system
outputs are compared to the targets.
• The learning rule is then used to adjust the weights
and biases of the system in order to move the network
outputs closer to the targets.
18
Supervised Learning
• Supervised learning is used in general to tackle
pattern recognition, data classification, and function
approximation problems.
• Common models include linear regression, decision
trees, and support vector machines.
19
How Supervised Learning works
• We consider systems that apply a function f() to input
items x and return an output y= f(x).
20
How Supervised Learning works
• Typically an appropriate machine learning algorithm is
used to estimate the target function f() with a learned
model g().
21
Supervised Learning: Training
• Supervised learning is conducted in two stages (i.e.
training and testing) using well labeled data, D, and a
machine learning algorithm.
23
Supervised Learning: Testing
• During testing, the labeled test data (Dtest) is partitioned
into raw test data (Xtest) and test labels (Ytest)
• The learned model g() is then applied to the raw test data
24
Supervised Learning: Evaluation
• Evaluate by comparing predicted labels against the test
labels and report level of accuracy or errors
25
Supervised Learning - Example
26
Supervised Learning - Example
27
Supervised Learning - Example
28
Supervised Learning - Example
29
Supervised Learning - Example
30
Supervised Learning - Example
31
Unsupervised Learning
• Find patterns in unlabeled data, identifying underlying
structures and groupings.
• The weights and biases are modified in response to
system inputs only. i.e. there are no target outputs
available.
• Most of these algorithms perform clustering operations
i.e. categorize the input patterns into a finite number of
classes.
• It is useful in such applications as vector quantization,
data mining.
32
Unsupervised Learning
33
Unsupervised Learning
34
Unsupervised Learning
35
Unsupervised Learning
36
Unsupervised Learning
37
Reinforced Learning
• Learn by interacting with an environment, receiving
rewards or penalties to guide their decision-making.
• Similar to supervised learning, except that the system
interacts with environment and not labeled data,
instead of providing the correct output for the system,
the algorithm is only given a grade which indicates the
performance of the system i.e. think of it as
Reward/Penalty type of learning.
• Reinforcement learning is used extensively to solve
problems involving optimal control, Markov Decision
Problems MDP, and other dynamic programming
related learning problems.
38
Reinforced Learning
39
Supervised vs Unsupervised
What's the right learning solution?
What's the right learning solution?
Why study Machine Learning
• To build computer systems that automatically improve
their performance with experience.
− Autonomous mobile systems that learn to navigate
from their own experience.
− Data mining systems that automatically discover
useful patterns from historical data
− Search engines that automatically customize to the
users 'interests
• To discover fundamental laws that govern all learning
processes
− What learning problems can be solved?
− When can we trust the output of a learning
algorithm?
44
Why study Machine Learning
• To seek theory that relates to:
− Probability of successful learning
− Number of training examples
− Complexity of hypothesis space
− Accuracy to which target concept is approximated
− Manner in which training examples are presented
• To understand human and animal learning
− Use ML theories and algorithms understand
human and animal learning processes.
− Understand the role of motivation, fear, urgency in
human and animal learning.
− Develop a general theory of learning processes
covering both animals and machines 45
Key Machine Learning Issues
• Modeling
− How to formulate application problems as machine
learning problems?
− How to represent the data?
− Learning Protocols (where is the data & labels
coming from?)
• Representation
− What functions should we learn (hypothesis
spaces)?
− How to map raw input to an instance space?
− Any rigorous way to find these? Any general
approach?
46
Key Machine Learning Issues
• Algorithms
− What are good algorithms?
− How do we define success?
− Generalization Vs. over fitting
47