SlideShare une entreprise Scribd logo
1  sur  12
Distance Function
Axioms of a Distance Measure
d is a distance measure if it is a function from pairs of points to real
numbers such that:
1. d(x,y) > 0.
2. d(x,y) = 0 if x = y.
3. d(x,y) = d(y,x).
4. d(x,y) < d(x,z) + d(z,y) (triangle inequality )
Distance Measure
Two major classes of distance measure:
1. Euclidean
2. Non-Euclidean
Euclidean Vs. Non-Euclidean
 A Euclidean space has some number of real-valued dimensions
and “dense” points.
✘ There is a notion of “average” of two points.
✘ A Euclidean distance is based on the locations of points in such a
space.
 A Non-Euclidean distance is based on properties of points, but not
their “location” in a space.
Some Euclidean Distances
o L2 norm : d(x,y) = square root of the sum of the squares of the
differences between x and y in each dimension.
The most common notion of “distance.”
o L1 norm : sum of the differences in each dimension.
Manhattan distance = distance if you had to travel along
coordinates only.
Examples of Euclidean Distances
a = (5,5)
b = (9,8)L2-norm:
dist(x,y) =
(42+32) = 5
L1-norm:
dist(x,y) =
4+3 = 7
Non-Euclidean Distances
o Jaccard distance for sets = 1 minus Jaccard similarity.
o Cosine distance = angle between vectors from the origin
to the points in question.
o Edit distance = number of inserts and deletes to change
one string into another.
o Hamming Distance = number of positions in which bit
vectors differ.
Jaccard Distance for Sets (Bit-Vectors)
o Example: p1 = 10111; p2 = 10011.
o Size of intersection = 3; size of union = 4, Jaccard similarity (not
distance) = 3/4.
o d(x,y) = 1 – (Jaccard similarity) = 1/4.
Cosine Distance
o Think of a point as a vector from the origin (0,0,…,0) to its location.
o Two points’ vectors make an angle, whose cosine is the normalized
dot-product of the vectors: p1.p2/|p2||p1|.
Example: p1 = 00111; p2 = 10011.
p1.p2 = 2; |p1| = |p2| = 3.
cos() = 2/3;  is about 48 degrees.
Cosine-Measure Diagram
p2p1.p2

|p2|
d (p1, p2) =  = arccos(p1.p2/|p2||p1|)
Edit Distance
The edit distance of two strings is the number of inserts and deletes of
characters needed to turn one into the other.
E.g.:
o x = abcde ; y = bcduve.
o Turn x into y by deleting a, then inserting u and v after d.
o Edit distance = 3.
Hamming Distance
✘ Hamming distance is the number of positions in which bit-vectors
differ.
✘ Example: p1 = 10101; p2 = 10011.
✘ d(p1, p2) = 2 because the bit-vectors differ in the 3rd and 4th
positions.

Contenu connexe

Tendances

Linear regression
Linear regressionLinear regression
Linear regressionMartinHogg9
 
K means Clustering
K means ClusteringK means Clustering
K means ClusteringEdureka!
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regressionkishanthkumaar
 
Fuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFarah M. Altufaili
 
Unsupervised learning (clustering)
Unsupervised learning (clustering)Unsupervised learning (clustering)
Unsupervised learning (clustering)Pravinkumar Landge
 
2.3 bayesian classification
2.3 bayesian classification2.3 bayesian classification
2.3 bayesian classificationKrish_ver2
 
Dimensionality Reduction
Dimensionality ReductionDimensionality Reduction
Dimensionality Reductionmrizwan969
 
Feature Selection in Machine Learning
Feature Selection in Machine LearningFeature Selection in Machine Learning
Feature Selection in Machine LearningUpekha Vandebona
 
Principal component analysis and lda
Principal component analysis and ldaPrincipal component analysis and lda
Principal component analysis and ldaSuresh Pokharel
 
Feature selection
Feature selectionFeature selection
Feature selectionDong Guo
 
Fuzzy c-means clustering for image segmentation
Fuzzy c-means  clustering for image segmentationFuzzy c-means  clustering for image segmentation
Fuzzy c-means clustering for image segmentationDharmesh Patel
 
12. Random Forest
12. Random Forest12. Random Forest
12. Random ForestFAO
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)Abhimanyu Dwivedi
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine LearningKnoldus Inc.
 
Outlier analysis and anomaly detection
Outlier analysis and anomaly detectionOutlier analysis and anomaly detection
Outlier analysis and anomaly detectionShantanuDeosthale
 
Machine Learning - Ensemble Methods
Machine Learning - Ensemble MethodsMachine Learning - Ensemble Methods
Machine Learning - Ensemble MethodsAndrew Ferlitsch
 

Tendances (20)

Linear regression
Linear regressionLinear regression
Linear regression
 
K means Clustering
K means ClusteringK means Clustering
K means Clustering
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
 
Fuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clustering
 
Unsupervised learning (clustering)
Unsupervised learning (clustering)Unsupervised learning (clustering)
Unsupervised learning (clustering)
 
Pattern Recognition
Pattern RecognitionPattern Recognition
Pattern Recognition
 
2.3 bayesian classification
2.3 bayesian classification2.3 bayesian classification
2.3 bayesian classification
 
Dimensionality Reduction
Dimensionality ReductionDimensionality Reduction
Dimensionality Reduction
 
Feature Selection in Machine Learning
Feature Selection in Machine LearningFeature Selection in Machine Learning
Feature Selection in Machine Learning
 
Principal component analysis and lda
Principal component analysis and ldaPrincipal component analysis and lda
Principal component analysis and lda
 
Feature selection
Feature selectionFeature selection
Feature selection
 
Fuzzy c-means clustering for image segmentation
Fuzzy c-means  clustering for image segmentationFuzzy c-means  clustering for image segmentation
Fuzzy c-means clustering for image segmentation
 
12. Random Forest
12. Random Forest12. Random Forest
12. Random Forest
 
Machine learning session4(linear regression)
Machine learning   session4(linear regression)Machine learning   session4(linear regression)
Machine learning session4(linear regression)
 
Cluster Analysis
Cluster Analysis Cluster Analysis
Cluster Analysis
 
Kernel Method
Kernel MethodKernel Method
Kernel Method
 
=SLAM ppt.pdf
=SLAM ppt.pdf=SLAM ppt.pdf
=SLAM ppt.pdf
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine Learning
 
Outlier analysis and anomaly detection
Outlier analysis and anomaly detectionOutlier analysis and anomaly detection
Outlier analysis and anomaly detection
 
Machine Learning - Ensemble Methods
Machine Learning - Ensemble MethodsMachine Learning - Ensemble Methods
Machine Learning - Ensemble Methods
 

En vedette

Profiler for Smartphone Users Interests Using Modified Hierarchical Agglomera...
Profiler for Smartphone Users Interests Using Modified Hierarchical Agglomera...Profiler for Smartphone Users Interests Using Modified Hierarchical Agglomera...
Profiler for Smartphone Users Interests Using Modified Hierarchical Agglomera...Lippo Group Digital
 
Analisis performa kecepatan mapreduce pada hadoop menggunakan tcp packet flow...
Analisis performa kecepatan mapreduce pada hadoop menggunakan tcp packet flow...Analisis performa kecepatan mapreduce pada hadoop menggunakan tcp packet flow...
Analisis performa kecepatan mapreduce pada hadoop menggunakan tcp packet flow...Lippo Group Digital
 
Automatic Subspace Clustering of High Dimensional Data for Data Mining Applic...
Automatic Subspace Clustering of High Dimensional Data for DataMining Applic...Automatic Subspace Clustering of High Dimensional Data for DataMining Applic...
Automatic Subspace Clustering of High Dimensional Data for Data Mining Applic...Hajer Trabelsi
 
Understanding Random Forests: From Theory to Practice
Understanding Random Forests: From Theory to PracticeUnderstanding Random Forests: From Theory to Practice
Understanding Random Forests: From Theory to PracticeGilles Louppe
 
2 distance
2 distance2 distance
2 distanceg2desai
 

En vedette (15)

Clusteryanam
ClusteryanamClusteryanam
Clusteryanam
 
Profiler for Smartphone Users Interests Using Modified Hierarchical Agglomera...
Profiler for Smartphone Users Interests Using Modified Hierarchical Agglomera...Profiler for Smartphone Users Interests Using Modified Hierarchical Agglomera...
Profiler for Smartphone Users Interests Using Modified Hierarchical Agglomera...
 
Analisis performa kecepatan mapreduce pada hadoop menggunakan tcp packet flow...
Analisis performa kecepatan mapreduce pada hadoop menggunakan tcp packet flow...Analisis performa kecepatan mapreduce pada hadoop menggunakan tcp packet flow...
Analisis performa kecepatan mapreduce pada hadoop menggunakan tcp packet flow...
 
The Cognitive Net is Coming
The Cognitive Net is ComingThe Cognitive Net is Coming
The Cognitive Net is Coming
 
Feature Selection
Feature Selection Feature Selection
Feature Selection
 
Fall detection
Fall detectionFall detection
Fall detection
 
Domain specific IoT
Domain specific IoTDomain specific IoT
Domain specific IoT
 
Automatic Subspace Clustering of High Dimensional Data for Data Mining Applic...
Automatic Subspace Clustering of High Dimensional Data for DataMining Applic...Automatic Subspace Clustering of High Dimensional Data for DataMining Applic...
Automatic Subspace Clustering of High Dimensional Data for Data Mining Applic...
 
Decision tree and random forest
Decision tree and random forestDecision tree and random forest
Decision tree and random forest
 
18 Data Streams
18 Data Streams18 Data Streams
18 Data Streams
 
Understanding Random Forests: From Theory to Practice
Understanding Random Forests: From Theory to PracticeUnderstanding Random Forests: From Theory to Practice
Understanding Random Forests: From Theory to Practice
 
6 clustering
6 clustering6 clustering
6 clustering
 
Cluster Analysis
Cluster AnalysisCluster Analysis
Cluster Analysis
 
Cluster analysis
Cluster analysisCluster analysis
Cluster analysis
 
2 distance
2 distance2 distance
2 distance
 

Similaire à Distance function

Digital Distance Geometry
Digital Distance GeometryDigital Distance Geometry
Digital Distance Geometryppd1961
 
C2 st lecture 4 handout
C2 st lecture 4 handoutC2 st lecture 4 handout
C2 st lecture 4 handoutfatima d
 
Lesson 6 differentials parametric-curvature
Lesson 6 differentials parametric-curvatureLesson 6 differentials parametric-curvature
Lesson 6 differentials parametric-curvatureLawrence De Vera
 
Applications of Differential Calculus in real life
Applications of Differential Calculus in real life Applications of Differential Calculus in real life
Applications of Differential Calculus in real life OlooPundit
 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximationTarun Gehlot
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi54MahakBansal
 
Calculus a Functions of Several Variables
Calculus a Functions of Several Variables Calculus a Functions of Several Variables
Calculus a Functions of Several Variables Harington Dinklage
 
An Algorithm to Find the Largest Circle inside a Polygon
An Algorithm to Find the Largest Circle inside a PolygonAn Algorithm to Find the Largest Circle inside a Polygon
An Algorithm to Find the Largest Circle inside a PolygonKasun Ranga Wijeweera
 
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docxMA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docxinfantsuk
 
(5) Ellipse (Theory). Module-3pdf
(5) Ellipse (Theory). Module-3pdf(5) Ellipse (Theory). Module-3pdf
(5) Ellipse (Theory). Module-3pdfRajuSingh806014
 
Google BigQuery is a very popular enterprise warehouse that’s built with a co...
Google BigQuery is a very popular enterprise warehouse that’s built with a co...Google BigQuery is a very popular enterprise warehouse that’s built with a co...
Google BigQuery is a very popular enterprise warehouse that’s built with a co...Abebe Admasu
 
Weight enumerators of block codes and the mc williams
Weight  enumerators of block codes and  the mc williamsWeight  enumerators of block codes and  the mc williams
Weight enumerators of block codes and the mc williamsMadhumita Tamhane
 
Geometry unit 12.1
Geometry unit 12.1Geometry unit 12.1
Geometry unit 12.1Mark Ryder
 
Poggi analytics - distance - 1a
Poggi   analytics - distance - 1aPoggi   analytics - distance - 1a
Poggi analytics - distance - 1aGaston Liberman
 

Similaire à Distance function (20)

Cs345 cl
Cs345 clCs345 cl
Cs345 cl
 
Digital Distance Geometry
Digital Distance GeometryDigital Distance Geometry
Digital Distance Geometry
 
C2 st lecture 4 handout
C2 st lecture 4 handoutC2 st lecture 4 handout
C2 st lecture 4 handout
 
Lesson 6 differentials parametric-curvature
Lesson 6 differentials parametric-curvatureLesson 6 differentials parametric-curvature
Lesson 6 differentials parametric-curvature
 
Double integration
Double integrationDouble integration
Double integration
 
Applications of Differential Calculus in real life
Applications of Differential Calculus in real life Applications of Differential Calculus in real life
Applications of Differential Calculus in real life
 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximation
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
 
Calculus a Functions of Several Variables
Calculus a Functions of Several Variables Calculus a Functions of Several Variables
Calculus a Functions of Several Variables
 
2 vectors notes
2 vectors notes2 vectors notes
2 vectors notes
 
Assignment6
Assignment6Assignment6
Assignment6
 
An Algorithm to Find the Largest Circle inside a Polygon
An Algorithm to Find the Largest Circle inside a PolygonAn Algorithm to Find the Largest Circle inside a Polygon
An Algorithm to Find the Largest Circle inside a Polygon
 
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docxMA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
 
(5) Ellipse (Theory). Module-3pdf
(5) Ellipse (Theory). Module-3pdf(5) Ellipse (Theory). Module-3pdf
(5) Ellipse (Theory). Module-3pdf
 
Google BigQuery is a very popular enterprise warehouse that’s built with a co...
Google BigQuery is a very popular enterprise warehouse that’s built with a co...Google BigQuery is a very popular enterprise warehouse that’s built with a co...
Google BigQuery is a very popular enterprise warehouse that’s built with a co...
 
Weight enumerators of block codes and the mc williams
Weight  enumerators of block codes and  the mc williamsWeight  enumerators of block codes and  the mc williams
Weight enumerators of block codes and the mc williams
 
Geometry unit 12.1
Geometry unit 12.1Geometry unit 12.1
Geometry unit 12.1
 
Poggi analytics - distance - 1a
Poggi   analytics - distance - 1aPoggi   analytics - distance - 1a
Poggi analytics - distance - 1a
 
Lecture_note2.pdf
Lecture_note2.pdfLecture_note2.pdf
Lecture_note2.pdf
 
[PPT]
[PPT][PPT]
[PPT]
 

Plus de Lippo Group Digital

Behavior-Based Authentication System Based on Smartphone Life-Logs Data
Behavior-Based Authentication System Based on Smartphone Life-Logs DataBehavior-Based Authentication System Based on Smartphone Life-Logs Data
Behavior-Based Authentication System Based on Smartphone Life-Logs DataLippo Group Digital
 
A web based iptv content syndication system for personalized content guide
A web based iptv content syndication system for personalized content guideA web based iptv content syndication system for personalized content guide
A web based iptv content syndication system for personalized content guideLippo Group Digital
 
Time-based DDoS Detection and Mitigation for SDN Controller
Time-based DDoS Detection and Mitigation for SDN ControllerTime-based DDoS Detection and Mitigation for SDN Controller
Time-based DDoS Detection and Mitigation for SDN ControllerLippo Group Digital
 
Caching in Information Centric Network (ICN)
Caching in Information Centric Network (ICN)Caching in Information Centric Network (ICN)
Caching in Information Centric Network (ICN)Lippo Group Digital
 
Analisa pengaruh block size pada hdfs terhadap kecepatan
Analisa pengaruh block size pada hdfs terhadap kecepatanAnalisa pengaruh block size pada hdfs terhadap kecepatan
Analisa pengaruh block size pada hdfs terhadap kecepatanLippo Group Digital
 

Plus de Lippo Group Digital (6)

Behavior-Based Authentication System Based on Smartphone Life-Logs Data
Behavior-Based Authentication System Based on Smartphone Life-Logs DataBehavior-Based Authentication System Based on Smartphone Life-Logs Data
Behavior-Based Authentication System Based on Smartphone Life-Logs Data
 
The future internet web 3.0
The future internet  web 3.0The future internet  web 3.0
The future internet web 3.0
 
A web based iptv content syndication system for personalized content guide
A web based iptv content syndication system for personalized content guideA web based iptv content syndication system for personalized content guide
A web based iptv content syndication system for personalized content guide
 
Time-based DDoS Detection and Mitigation for SDN Controller
Time-based DDoS Detection and Mitigation for SDN ControllerTime-based DDoS Detection and Mitigation for SDN Controller
Time-based DDoS Detection and Mitigation for SDN Controller
 
Caching in Information Centric Network (ICN)
Caching in Information Centric Network (ICN)Caching in Information Centric Network (ICN)
Caching in Information Centric Network (ICN)
 
Analisa pengaruh block size pada hdfs terhadap kecepatan
Analisa pengaruh block size pada hdfs terhadap kecepatanAnalisa pengaruh block size pada hdfs terhadap kecepatan
Analisa pengaruh block size pada hdfs terhadap kecepatan
 

Dernier

Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Dernier (20)

Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

Distance function

  • 2. Axioms of a Distance Measure d is a distance measure if it is a function from pairs of points to real numbers such that: 1. d(x,y) > 0. 2. d(x,y) = 0 if x = y. 3. d(x,y) = d(y,x). 4. d(x,y) < d(x,z) + d(z,y) (triangle inequality )
  • 3. Distance Measure Two major classes of distance measure: 1. Euclidean 2. Non-Euclidean
  • 4. Euclidean Vs. Non-Euclidean  A Euclidean space has some number of real-valued dimensions and “dense” points. ✘ There is a notion of “average” of two points. ✘ A Euclidean distance is based on the locations of points in such a space.  A Non-Euclidean distance is based on properties of points, but not their “location” in a space.
  • 5. Some Euclidean Distances o L2 norm : d(x,y) = square root of the sum of the squares of the differences between x and y in each dimension. The most common notion of “distance.” o L1 norm : sum of the differences in each dimension. Manhattan distance = distance if you had to travel along coordinates only.
  • 6. Examples of Euclidean Distances a = (5,5) b = (9,8)L2-norm: dist(x,y) = (42+32) = 5 L1-norm: dist(x,y) = 4+3 = 7
  • 7. Non-Euclidean Distances o Jaccard distance for sets = 1 minus Jaccard similarity. o Cosine distance = angle between vectors from the origin to the points in question. o Edit distance = number of inserts and deletes to change one string into another. o Hamming Distance = number of positions in which bit vectors differ.
  • 8. Jaccard Distance for Sets (Bit-Vectors) o Example: p1 = 10111; p2 = 10011. o Size of intersection = 3; size of union = 4, Jaccard similarity (not distance) = 3/4. o d(x,y) = 1 – (Jaccard similarity) = 1/4.
  • 9. Cosine Distance o Think of a point as a vector from the origin (0,0,…,0) to its location. o Two points’ vectors make an angle, whose cosine is the normalized dot-product of the vectors: p1.p2/|p2||p1|. Example: p1 = 00111; p2 = 10011. p1.p2 = 2; |p1| = |p2| = 3. cos() = 2/3;  is about 48 degrees.
  • 10. Cosine-Measure Diagram p2p1.p2  |p2| d (p1, p2) =  = arccos(p1.p2/|p2||p1|)
  • 11. Edit Distance The edit distance of two strings is the number of inserts and deletes of characters needed to turn one into the other. E.g.: o x = abcde ; y = bcduve. o Turn x into y by deleting a, then inserting u and v after d. o Edit distance = 3.
  • 12. Hamming Distance ✘ Hamming distance is the number of positions in which bit-vectors differ. ✘ Example: p1 = 10101; p2 = 10011. ✘ d(p1, p2) = 2 because the bit-vectors differ in the 3rd and 4th positions.