SlideShare a Scribd company logo
1 of 16
Download to read offline
Instance Based Learning
Read Ch. 8]
k-Nearest Neighbor
Locally weighted regression
Radial basis functions
Case-based reasoning
Lazy and eager learning
199 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Instance-Based Learning
Key idea: just store all training examples hxi; f (xi)i
Nearest neighbor:
Given query instance xq, rst locate nearest
training example xn, then estimate
^f (xq) f (xn)
k-Nearest neighbor:
Given xq, take vote among its k nearest nbrs (if
discrete-valued target function)
take mean of f values of k nearest nbrs (if
real-valued)
^f (xq)
Pk
i=1 f (xi)
k
200 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
When To Consider Nearest Neighbor
Instances map to points in <n
Less than 20 attributes per instance
Lots of training data
Advantages:
Training is very fast
Learn complex target functions
Don't lose information
Disadvantages:
Slow at query time
Easily fooled by irrelevant attributes
201 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Voronoi Diagram
+
+
−
−
−
+
−
−
+
xq
202 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Behavior in the Limit
Consider p(x) de nes probability that instance x
will be labeled 1 (positive) versus 0 (negative).
Nearest neighbor:
As number of training examples ! 1,
approaches Gibbs Algorithm
Gibbs: with probability p(x) predict 1, else 0
k-Nearest neighbor:
As number of training examples ! 1 and k gets
large, approaches Bayes optimal
Bayes optimal: if p(x) > :5 then predict 1, else 0
Note Gibbs has at most twice the expected error of
Bayes optimal
203 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Distance-Weighted kNN
Might want weight nearer neighbors more heavily...
^f (xq)
Pk
i=1 wif (xi)
Pk
i=1 wi
where
wi
1
d(xq; xi)2
and d(xq; xi) is distance between xq and xi
Note now it makes sense to use all training
examples instead of just k
! Shepard's method
204 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Curse of Dimensionality
Imagine instances described by 20 attributes, but
only 2 are relevant to target function
Curse of dimensionality: nearest nbr is easily
mislead when high-dimensional X
One approach:
Stretch jth axis by weight zj, where z1; : : : ; zn
chosen to minimize prediction error
Use cross-validation to automatically choose
weights z1; : : : ; zn
Note setting zj to zero eliminates this dimension
altogether
see Moore and Lee, 1994]
205 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Locally Weighted Regression
Note kNN forms local approximation to f for each
query point xq
Why not form an explicit approximation ^f (x) for
region surrounding xq
Fit linear function to k nearest neighbors
Fit quadratic, ...
Produces piecewise approximation" to f
Several choices of error to minimize:
Squared error over k nearest neighbors
E1(xq) 1
2
X
x2 k nearest nbrs of xq
(f (x) ? ^f (x))2
Distance-weighted squared error over all nbrs
E2(xq) 1
2
X
x2D
(f (x) ? ^f (x))2
K(d(xq ; x))
: : :
206 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Radial Basis Function Networks
Global approximation to target function, in
terms of linear combination of local
approximations
Used, e.g., for image classi cation
A di erent kind of neural network
Closely related to distance-weighted regression,
but eager" instead of lazy"
207 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Radial Basis Function Networks
...
...
f(x)
w1w0 wk
1
1a (x) 2
a (x) n
a (x)
where ai(x) are the attributes describing instance
x, and
f (x) = w0 +
kX
u=1
wuKu(d(xu; x))
One common choice for Ku(d(xu; x)) is
Ku(d(xu; x)) = e
? 1
2 2
u
d
2(xu;x)
208 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Training Radial Basis Function Net-
works
Q1: What xu to use for each kernel function
Ku(d(xu; x))
Scatter uniformly throughout instance space
Or use training instances (re ects instance
distribution)
Q2: How to train weights (assume here Gaussian
Ku)
First choose variance (and perhaps mean) for
each Ku
{ e.g., use EM
Then hold Ku xed, and train linear output layer
{ e cient methods to t linear function
209 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Case-Based Reasoning
Can apply instance-based learning even when
X 6= <n
! need di erent distance" metric
Case-Based Reasoning is instance-based learning
applied to instances with symbolic logic
descriptions
((user-complaint error53-on-shutdown)
(cpu-model PowerPC)
(operating-system Windows)
(network-connection PCIA)
(memory 48meg)
(installed-applications Excel Netscape VirusScan)
(disk 1gig)
(likely-cause ???))
210 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Case-Based Reasoning in CADET
CADET: 75 stored examples of mechanical devices
each training example: h qualitative function,
mechanical structurei
new query: desired function,
target value: mechanical structure for this
function
Distance metric: match qualitative function
descriptions
211 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Case-Based Reasoning in CADET
A stored case:
+
+
+
+
Function:
T−junction pipe
T
Q
= temperature
= waterflow
Structure:
+
+
+
+
−
+
+
+
+
Function:Structure:
?
+
A problem specification: Water faucet
Q ,T
1
2
1
Q ,T
Q ,T
2
3 3
Q
Q
T
T
Q
T
1
2
1
2
3
3
C
C
t
f
Q
T
c
c
Q
T
h
h
Q
T
m
m
212 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Case-Based Reasoning in CADET
Instances represented by rich structural
descriptions
Multiple cases retrieved (and combined) to form
solution to new problem
Tight coupling between case retrieval and
problem solving
Bottom line:
Simple matching of cases useful for tasks such as
answering help-desk queries
Area of ongoing research
213 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Lazy and Eager Learning
Lazy: wait for query before generalizing
k-Nearest Neighbor, Case based reasoning
Eager: generalize before seeing query
Radial basis function networks, ID3,
Backpropagation, NaiveBayes, : : :
Does it matter?
Eager learner must create global approximation
Lazy learner can create many local
approximations
if they use same H, lazy can represent more
complex fns (e.g., consider H = linear functions)
214 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997

More Related Content

What's hot

2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networksijcoa
 
Gaussian processing
Gaussian processingGaussian processing
Gaussian processing홍배 김
 
Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Gopi Saiteja
 
Digit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDigit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDing Li
 
Availability of a Redundant System with Two Parallel Active Components
Availability of a Redundant System with Two Parallel Active ComponentsAvailability of a Redundant System with Two Parallel Active Components
Availability of a Redundant System with Two Parallel Active Componentstheijes
 
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...홍배 김
 
Fast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in PracticeFast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in PracticeRakuten Group, Inc.
 
2.5D Clip-Surfaces for Technical Visualization
2.5D Clip-Surfaces for Technical Visualization2.5D Clip-Surfaces for Technical Visualization
2.5D Clip-Surfaces for Technical VisualizationMatthias Trapp
 
Low-rank matrix approximations in Python by Christian Thurau PyData 2014
Low-rank matrix approximations in Python by Christian Thurau PyData 2014Low-rank matrix approximations in Python by Christian Thurau PyData 2014
Low-rank matrix approximations in Python by Christian Thurau PyData 2014PyData
 
Generalized Notions of Data Depth
Generalized Notions of Data DepthGeneralized Notions of Data Depth
Generalized Notions of Data DepthMukund Raj
 
Introducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowIntroducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowEtsuji Nakai
 
Geometry Batching Using Texture-Arrays
Geometry Batching Using Texture-ArraysGeometry Batching Using Texture-Arrays
Geometry Batching Using Texture-ArraysMatthias Trapp
 
Context-Aware Recommender System Based on Boolean Matrix Factorisation
Context-Aware Recommender System Based on Boolean Matrix FactorisationContext-Aware Recommender System Based on Boolean Matrix Factorisation
Context-Aware Recommender System Based on Boolean Matrix FactorisationDmitrii Ignatov
 
Recommendation System --Theory and Practice
Recommendation System --Theory and PracticeRecommendation System --Theory and Practice
Recommendation System --Theory and PracticeKimikazu Kato
 
Matrix transposition
Matrix transpositionMatrix transposition
Matrix transposition동호 이
 

What's hot (20)

2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks
 
Gaussian processing
Gaussian processingGaussian processing
Gaussian processing
 
Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Ee693 sept2014quizgt2
Ee693 sept2014quizgt2
 
Profiling in Python
Profiling in PythonProfiling in Python
Profiling in Python
 
Digit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDigit recognizer by convolutional neural network
Digit recognizer by convolutional neural network
 
Availability of a Redundant System with Two Parallel Active Components
Availability of a Redundant System with Two Parallel Active ComponentsAvailability of a Redundant System with Two Parallel Active Components
Availability of a Redundant System with Two Parallel Active Components
 
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
 
Fast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in PracticeFast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in Practice
 
Subquad multi ff
Subquad multi ffSubquad multi ff
Subquad multi ff
 
2.5D Clip-Surfaces for Technical Visualization
2.5D Clip-Surfaces for Technical Visualization2.5D Clip-Surfaces for Technical Visualization
2.5D Clip-Surfaces for Technical Visualization
 
Recursive algorithms
Recursive algorithmsRecursive algorithms
Recursive algorithms
 
Low-rank matrix approximations in Python by Christian Thurau PyData 2014
Low-rank matrix approximations in Python by Christian Thurau PyData 2014Low-rank matrix approximations in Python by Christian Thurau PyData 2014
Low-rank matrix approximations in Python by Christian Thurau PyData 2014
 
Generalized Notions of Data Depth
Generalized Notions of Data DepthGeneralized Notions of Data Depth
Generalized Notions of Data Depth
 
Introducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlowIntroducton to Convolutional Nerural Network with TensorFlow
Introducton to Convolutional Nerural Network with TensorFlow
 
Geometry Batching Using Texture-Arrays
Geometry Batching Using Texture-ArraysGeometry Batching Using Texture-Arrays
Geometry Batching Using Texture-Arrays
 
upgrade2013
upgrade2013upgrade2013
upgrade2013
 
Context-Aware Recommender System Based on Boolean Matrix Factorisation
Context-Aware Recommender System Based on Boolean Matrix FactorisationContext-Aware Recommender System Based on Boolean Matrix Factorisation
Context-Aware Recommender System Based on Boolean Matrix Factorisation
 
Recommendation System --Theory and Practice
Recommendation System --Theory and PracticeRecommendation System --Theory and Practice
Recommendation System --Theory and Practice
 
Matrix transposition
Matrix transpositionMatrix transposition
Matrix transposition
 
10_rnn.pdf
10_rnn.pdf10_rnn.pdf
10_rnn.pdf
 

Similar to Ch8

Matrix Computations in Machine Learning
Matrix Computations in Machine LearningMatrix Computations in Machine Learning
Matrix Computations in Machine Learningbutest
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence butest
 
Approximation in Stochastic Integer Programming
Approximation in Stochastic Integer ProgrammingApproximation in Stochastic Integer Programming
Approximation in Stochastic Integer ProgrammingSSA KPI
 
Stanford ICME Lecture on Why Deep Learning Works
Stanford ICME Lecture on Why Deep Learning WorksStanford ICME Lecture on Why Deep Learning Works
Stanford ICME Lecture on Why Deep Learning WorksCharles Martin
 
Linear Discrimination Centering on Support Vector Machines
Linear Discrimination Centering on Support Vector MachinesLinear Discrimination Centering on Support Vector Machines
Linear Discrimination Centering on Support Vector Machinesbutest
 
20070702 Text Categorization
20070702 Text Categorization20070702 Text Categorization
20070702 Text Categorizationmidi
 
support vector machine algorithm in machine learning
support vector machine algorithm in machine learningsupport vector machine algorithm in machine learning
support vector machine algorithm in machine learningSamGuy7
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysisbutest
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysisbutest
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysisbutest
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysisbutest
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysisbutest
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysisbutest
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysisbutest
 
Towards typesafe deep learning in scala
Towards typesafe deep learning in scalaTowards typesafe deep learning in scala
Towards typesafe deep learning in scalaTongfei Chen
 
Jörg Stelzer
Jörg StelzerJörg Stelzer
Jörg Stelzerbutest
 

Similar to Ch8 (20)

Matrix Computations in Machine Learning
Matrix Computations in Machine LearningMatrix Computations in Machine Learning
Matrix Computations in Machine Learning
 
Lecture4 xing
Lecture4 xingLecture4 xing
Lecture4 xing
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence
 
Approximation in Stochastic Integer Programming
Approximation in Stochastic Integer ProgrammingApproximation in Stochastic Integer Programming
Approximation in Stochastic Integer Programming
 
SVM (2).ppt
SVM (2).pptSVM (2).ppt
SVM (2).ppt
 
Stanford ICME Lecture on Why Deep Learning Works
Stanford ICME Lecture on Why Deep Learning WorksStanford ICME Lecture on Why Deep Learning Works
Stanford ICME Lecture on Why Deep Learning Works
 
Linear Discrimination Centering on Support Vector Machines
Linear Discrimination Centering on Support Vector MachinesLinear Discrimination Centering on Support Vector Machines
Linear Discrimination Centering on Support Vector Machines
 
20070702 Text Categorization
20070702 Text Categorization20070702 Text Categorization
20070702 Text Categorization
 
Support Vector Machine.ppt
Support Vector Machine.pptSupport Vector Machine.ppt
Support Vector Machine.ppt
 
svm.ppt
svm.pptsvm.ppt
svm.ppt
 
support vector machine algorithm in machine learning
support vector machine algorithm in machine learningsupport vector machine algorithm in machine learning
support vector machine algorithm in machine learning
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysis
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysis
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysis
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysis
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysis
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysis
 
Machine Learning and Statistical Analysis
Machine Learning and Statistical AnalysisMachine Learning and Statistical Analysis
Machine Learning and Statistical Analysis
 
Towards typesafe deep learning in scala
Towards typesafe deep learning in scalaTowards typesafe deep learning in scala
Towards typesafe deep learning in scala
 
Jörg Stelzer
Jörg StelzerJörg Stelzer
Jörg Stelzer
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

Ch8

  • 1. Instance Based Learning Read Ch. 8] k-Nearest Neighbor Locally weighted regression Radial basis functions Case-based reasoning Lazy and eager learning 199 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 2. Instance-Based Learning Key idea: just store all training examples hxi; f (xi)i Nearest neighbor: Given query instance xq, rst locate nearest training example xn, then estimate ^f (xq) f (xn) k-Nearest neighbor: Given xq, take vote among its k nearest nbrs (if discrete-valued target function) take mean of f values of k nearest nbrs (if real-valued) ^f (xq) Pk i=1 f (xi) k 200 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 3. When To Consider Nearest Neighbor Instances map to points in <n Less than 20 attributes per instance Lots of training data Advantages: Training is very fast Learn complex target functions Don't lose information Disadvantages: Slow at query time Easily fooled by irrelevant attributes 201 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 4. Voronoi Diagram + + − − − + − − + xq 202 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 5. Behavior in the Limit Consider p(x) de nes probability that instance x will be labeled 1 (positive) versus 0 (negative). Nearest neighbor: As number of training examples ! 1, approaches Gibbs Algorithm Gibbs: with probability p(x) predict 1, else 0 k-Nearest neighbor: As number of training examples ! 1 and k gets large, approaches Bayes optimal Bayes optimal: if p(x) > :5 then predict 1, else 0 Note Gibbs has at most twice the expected error of Bayes optimal 203 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 6. Distance-Weighted kNN Might want weight nearer neighbors more heavily... ^f (xq) Pk i=1 wif (xi) Pk i=1 wi where wi 1 d(xq; xi)2 and d(xq; xi) is distance between xq and xi Note now it makes sense to use all training examples instead of just k ! Shepard's method 204 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 7. Curse of Dimensionality Imagine instances described by 20 attributes, but only 2 are relevant to target function Curse of dimensionality: nearest nbr is easily mislead when high-dimensional X One approach: Stretch jth axis by weight zj, where z1; : : : ; zn chosen to minimize prediction error Use cross-validation to automatically choose weights z1; : : : ; zn Note setting zj to zero eliminates this dimension altogether see Moore and Lee, 1994] 205 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 8. Locally Weighted Regression Note kNN forms local approximation to f for each query point xq Why not form an explicit approximation ^f (x) for region surrounding xq Fit linear function to k nearest neighbors Fit quadratic, ... Produces piecewise approximation" to f Several choices of error to minimize: Squared error over k nearest neighbors E1(xq) 1 2 X x2 k nearest nbrs of xq (f (x) ? ^f (x))2 Distance-weighted squared error over all nbrs E2(xq) 1 2 X x2D (f (x) ? ^f (x))2 K(d(xq ; x)) : : : 206 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 9. Radial Basis Function Networks Global approximation to target function, in terms of linear combination of local approximations Used, e.g., for image classi cation A di erent kind of neural network Closely related to distance-weighted regression, but eager" instead of lazy" 207 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 10. Radial Basis Function Networks ... ... f(x) w1w0 wk 1 1a (x) 2 a (x) n a (x) where ai(x) are the attributes describing instance x, and f (x) = w0 + kX u=1 wuKu(d(xu; x)) One common choice for Ku(d(xu; x)) is Ku(d(xu; x)) = e ? 1 2 2 u d 2(xu;x) 208 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 11. Training Radial Basis Function Net- works Q1: What xu to use for each kernel function Ku(d(xu; x)) Scatter uniformly throughout instance space Or use training instances (re ects instance distribution) Q2: How to train weights (assume here Gaussian Ku) First choose variance (and perhaps mean) for each Ku { e.g., use EM Then hold Ku xed, and train linear output layer { e cient methods to t linear function 209 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 12. Case-Based Reasoning Can apply instance-based learning even when X 6= <n ! need di erent distance" metric Case-Based Reasoning is instance-based learning applied to instances with symbolic logic descriptions ((user-complaint error53-on-shutdown) (cpu-model PowerPC) (operating-system Windows) (network-connection PCIA) (memory 48meg) (installed-applications Excel Netscape VirusScan) (disk 1gig) (likely-cause ???)) 210 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 13. Case-Based Reasoning in CADET CADET: 75 stored examples of mechanical devices each training example: h qualitative function, mechanical structurei new query: desired function, target value: mechanical structure for this function Distance metric: match qualitative function descriptions 211 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 14. Case-Based Reasoning in CADET A stored case: + + + + Function: T−junction pipe T Q = temperature = waterflow Structure: + + + + − + + + + Function:Structure: ? + A problem specification: Water faucet Q ,T 1 2 1 Q ,T Q ,T 2 3 3 Q Q T T Q T 1 2 1 2 3 3 C C t f Q T c c Q T h h Q T m m 212 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 15. Case-Based Reasoning in CADET Instances represented by rich structural descriptions Multiple cases retrieved (and combined) to form solution to new problem Tight coupling between case retrieval and problem solving Bottom line: Simple matching of cases useful for tasks such as answering help-desk queries Area of ongoing research 213 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
  • 16. Lazy and Eager Learning Lazy: wait for query before generalizing k-Nearest Neighbor, Case based reasoning Eager: generalize before seeing query Radial basis function networks, ID3, Backpropagation, NaiveBayes, : : : Does it matter? Eager learner must create global approximation Lazy learner can create many local approximations if they use same H, lazy can represent more complex fns (e.g., consider H = linear functions) 214 lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997