Machine Learning. Measuring Distance. several slides from Bryan Pardo

Similar documents
Machine Learning. Measuring Distance. several slides from Bryan Pardo

Machine Perception of Music & Audio. Topic 9: Measuring Distance

Machine Learning. Topic 4: Measuring Distance

Metric-based classifiers. Nuno Vasconcelos UCSD

Data Mining: Data. Lecture Notes for Chapter 2. Introduction to Data Mining

Bayes Decision Theory - I

6 Distances. 6.1 Metrics. 6.2 Distances L p Distances

f(x) = 2x 2 + 2x - 4

University of Florida CISE department Gator Engineering. Clustering Part 1

Chapter 18 Quadratic Function 2

7 Distances. 7.1 Metrics. 7.2 Distances L p Distances

Notion of Distance. Metric Distance Binary Vector Distances Tangent Distance

Exercise solutions: concepts from chapter 5

Measurement and Data. Topics: Types of Data Distance Measurement Data Transformation Forms of Data Data Quality

Geometric View of Machine Learning Nearest Neighbor Classification. Slides adapted from Prof. Carpuat

9-1. The Function with Equation y = ax 2. Vocabulary. Graphing y = x 2. Lesson

STUDY KNOWHOW PROGRAM STUDY AND LEARNING CENTRE. Functions & Graphs

Patterns, Functions, & Relations Long-Term Memory Review Review 1

Optimal Data-Dependent Hashing for Approximate Near Neighbors

Analytic Geometry in Three Dimensions

20.2 Connecting Intercepts and Linear Factors

Algebra 1 Unit 9 Quadratic Equations

In order to take a closer look at what I m talking about, grab a sheet of graph paper and graph: y = x 2 We ll come back to that graph in a minute.

5.2 Solving Quadratic Equations by Factoring

8. BOOLEAN ALGEBRAS x x

CS249: ADVANCED DATA MINING

Lesson Goals. Unit 4 Polynomial/Rational Functions Quadratic Functions (Chap 0.3) Family of Quadratic Functions. Parabolas

Theory of LSH. Distance Measures LS Families of Hash Functions S-Curves

2-6. _ k x and y = _ k. The Graph of. Vocabulary. Lesson

QUADRATIC GRAPHS ALGEBRA 2. Dr Adrian Jannetta MIMA CMath FRAS INU0114/514 (MATHS 1) Quadratic Graphs 1/ 16 Adrian Jannetta

Unit 5, Day 1: Ratio s/proportions & Similar Polygons

Machine Learning. Gaussian Mixture Models. Zhiyao Duan & Bryan Pardo, Machine Learning: EECS 349 Fall

2. Jan 2010 qu June 2009 qu.8

Applications. 12 The Shapes of Algebra. 1. a. Write an equation that relates the coordinates x and y for points on the circle.

Graph and Write Equations of Ellipses. You graphed and wrote equations of parabolas and circles. You will graph and write equations of ellipses.

Unit 12 Study Notes 1 Systems of Equations

(MTH5109) GEOMETRY II: KNOTS AND SURFACES LECTURE NOTES. 1. Introduction to Curves and Surfaces

1.2 Relations. 20 Relations and Functions

7.2 Connecting Intercepts and Linear Factors

CS 175: Project in Artificial Intelligence. Slides 2: Measurement and Data, and Classification

High Dimensional Search Min- Hashing Locality Sensi6ve Hashing

Exercises. Bottled Water Consumption. U. S. Paper Recycling

Error Detection and Correction: Small Applications of Exclusive-Or

Identifying second degree equations

Essential Question How can you solve a nonlinear system of equations?

Some practical remarks (recap) Statistical Natural Language Processing. Today s lecture. Linear algebra. Why study linear algebra?

The Force Table Introduction: Theory:

Random Vectors. 1 Joint distribution of a random vector. 1 Joint distribution of a random vector

DM534: Introduction to Computer Science Autumn term Exercise Clustering: Clustering, Color Histograms

Lab 5 Forces Part 1. Physics 211 Lab. You will be using Newton s 2 nd Law to help you examine the nature of these forces.

Unit 2 Notes Packet on Quadratic Functions and Factoring

9.1.1 What else can I solve?

EXERCISES Chapter 15: Multiple Integrals. Evaluating Integrals in Cylindrical Coordinates

Lab 5 Forces Part 1. Physics 225 Lab. You will be using Newton s 2 nd Law to help you examine the nature of these forces.

(A) y = -5x + 1. (B) y = 1. (C) x = 1. (D) y = -2 x + 1 5

10.4 Nonlinear Inequalities and Systems of Inequalities. OBJECTIVES 1 Graph a Nonlinear Inequality. 2 Graph a System of Nonlinear Inequalities.

Vector Calculus Review

Conic Section: Circles

Answer Explanations. The SAT Subject Tests. Mathematics Level 1 & 2 TO PRACTICE QUESTIONS FROM THE SAT SUBJECT TESTS STUDENT GUIDE

16.5. Maclaurin and Taylor Series. Introduction. Prerequisites. Learning Outcomes

Clustering. Genome 559: Introduction to Statistical and Computational Genomics Elhanan Borenstein. Some slides adapted from Jacques van Helden

Section 1.2: Relations, from College Algebra: Corrected Edition by Carl Stitz, Ph.D. and Jeff Zeager, Ph.D. is available under a Creative Commons

Solve Quadratic Equations by Graphing

4-9. Solving Absolute Value Equations and Inequalities. Solving x = a. Lesson

ARCH 614 Note Set 2 S2011abn. Forces and Vectors

Machine Learning. Nonparametric Methods. Space of ML Problems. Todo. Histograms. Instance-Based Learning (aka non-parametric methods)

CSE446: non-parametric methods Spring 2017

Mathematics 309 Conic sections and their applicationsn. Chapter 2. Quadric figures. ai,j x i x j + b i x i + c =0. 1. Coordinate changes

UNIVERSIDAD CARLOS III DE MADRID MATHEMATICS II EXERCISES (SOLUTIONS )

2.5. Infinite Limits and Vertical Asymptotes. Infinite Limits

Physics 111. Lecture 10 (Walker: 5.5-6) Free Body Diagram Solving 2-D Force Problems Weight & Gravity. February 18, Quiz Monday - Chaps.

Probability Densities in Data Mining

Ch 5 Alg 2 L2 Note Sheet Key Do Activity 1 on your Ch 5 Activity Sheet.

CITS 4402 Computer Vision

Chapter 5: Quadratic Equations and Functions 5.1 Modeling Data With Quadratic Functions Quadratic Functions and Their Graphs

Dynamic Celt. Context: Product of inertia affects rotational motion

Kernel PCA, clustering and canonical correlation analysis

UNCORRECTED. To recognise the rules of a number of common algebraic relations: y = x 1 y 2 = x

CHAPTER 1-5 CREDIT INTERVENTION ASSIGNMENT

Machine Learning. Theory of Classification and Nonparametric Classifier. Lecture 2, January 16, What is theoretically the best classifier

9.11 Complex Rationals

Precalculus Honors - AP Calculus A Information and Summer Assignment

ENGI 4430 Advanced Calculus for Engineering Faculty of Engineering and Applied Science Problem Set 3 Solutions [Multiple Integration; Lines of Force]

Mining of Massive Datasets Jure Leskovec, AnandRajaraman, Jeff Ullman Stanford University

APPENDIX D Rotation and the General Second-Degree Equation

Metrics: Growth, dimension, expansion

Answers Investigation 2

4-4. Exact Values of Sines, Cosines, and Tangents

CMSC 422 Introduction to Machine Learning Lecture 4 Geometry and Nearest Neighbors. Furong Huang /

Tailored Bregman Ball Trees for Effective Nearest Neighbors

Bridge-Thickness Experiment. Student 2

Semi-Supervised Laplacian Regularization of Kernel Canonical Correlation Analysis

Gaussian Mixture Distance for Information Retrieval

Symmetry Arguments and the Role They Play in Using Gauss Law

ARCH 331 Note Set 3.1 Su2016abn. Forces and Vectors

UNCORRECTED SAMPLE PAGES. 3Quadratics. Chapter 3. Objectives

RELATIONS AND FUNCTIONS through

9.1.1 What else can I solve?

= x. Algebra II Notes Quadratic Functions Unit Graphing Quadratic Functions. Math Background

Lecture 3: Pattern Classification. Pattern classification

Transcription:

Machine Learning Measuring Distance several slides from Bran Pardo 1

Wh measure distance? Nearest neighbor requires a distance measure Also: Local search methods require a measure of localit (Frida) Clustering requires a distance measure (later) Search engines require a measure of similarit, etc.

Euclidean Distance What people intuitivel think of as distance Dimension 2 dd, = ( 1 1 ) + 2 2 2 Dimension 1

Generalized Euclidean Distance ), i( d i i n n n i i i R > =< > =< = = and,...,,,,...,, where ), ( 2 1 2 1 2 1/ 1 2 n = the number of dimensions

L p norms L p norms are all special cases of this: d(, ) n = i= 1 i i p 1/ p p changes the norm 1 = L 1 norm = Manhattan Distance : p = 1 2 = L 2 norm = Euclidean Distance : p = 2 Hamming Distance : p = 1and i, i { 0,1}

Weighting Dimensions Put point in cluster with the closest center of gravit? Which cluster should the red point go in? How do I measure distance in a wa that gives the right answer for both situations?

Weighting Dimensions Think Start End Put point in cluster with the closest center of gravit? Which cluster should the red point go in? How do I measure distance in a wa that gives the right answer for both situations?

Weighting Dimensions Pair Start End Put point in cluster with the closest center of gravit? Which cluster should the red point go in? How do I measure distance in a wa that gives the right answer for both situations?

Weighting Dimensions Share Put point in cluster with the closest center of gravit? Which cluster should the red point go in? How do I measure distance in a wa that gives the right answer for both situations?

Weighted Norms You can compensate b weighting our dimensions. d n 1/ (, ) = w p i i i i= 1 p This lets ou turn our circle of equal-distance into an elipse with aes parallel to the dimensions of the vectors.

Mahalanobis distance The region of constant Mahalanobis distance around the mean of a distribution forms an ellipsoid. The aes of this ellipsiod don t have to be parallel to the dimensions describing the vector Images from: http://www.aiaccess.net/english/glossaries/glosmod/e_gm_mahalanobis.htm 11

Calculating Mahalanobis d (, ) = ( ) T S 1 ( ) This matri S is called the covariance matri and is calculated from the data distribution 12

Take-awa on Mahalanobis Is good for nonsphericall smmetric distributions. Accounts for scaling of coordinate aes Can reduce to Euclidean 13

What is a metric? A metric has these four qualities. otherwise, call it a measure (triangle inequalit) ), ( ), ( ), ( (smmetr) ), ( ), ( (non - negative) 0 ), ( (refleivit) iff 0 ), ( z d z d d d d d d + = = =

Metric, or not? Driving distance with 1-wa streets Categorical Stuff : Is distance (Jazz to Blues to Rock) no less than distance (Jazz to Rock)?

Categorical Variables Consider feature vectors for genre & vocals: Genre: {Blues, Jazz, Rock, Hip Hop} Vocals: {vocals,no vocals} s1 = {rock, vocals} s2 = {jazz, no vocals} s3 = { rock, no vocals} Which two songs are more similar?

One Solution:Hamming distance Blues Jazz Rock Hip Hop 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 Vocals s1 = {rock, vocals} s2 = {jazz, no_vocals} s3 = { rock, no_vocals} Hamming Distance = number of different bits in two binar vectors

Hamming Distance {0,1}) ( and,...,,,,...,, where ), ( 2 1 2 1 1 > =< > =< = = i i n n n i i i, i d

Defining our own distance (an eample) How often does artist quote artist? Quote Frequenc Beethoven Beatles Liz Phair Beethoven 7 0 0 Beatles 4 5 0 Liz Phair? 1 2 Let s build a distance measure!

Defining our own distance (an eample) Beethoven Beatles Liz Phair Beethoven 7 0 0 Beatles 4 5 0 Liz Phair? 1 2 Quote frequenc Q Distance d(, ) = 1 f (, ) = value in table Q f Q z Artists (, ) f (, z)

Missing data What if, for some categor, on some eamples, there is no value given? Approaches: Discard all eamples missing the categor Fill in the blanks with the mean value Onl use a categor in the distance measure if both eamples give a value

Dealing with missing data ww ii = 1, if both iiand ii are defined 0,otherwise dd, = nn nn ww ww ii φφ( ii, ii ) ii ii=1 nn ii=1

Edit Distance Quer = string from finite alphabet Target = string from finite alphabet Cost of Edits = Distance Target: C A G E D - - Quer: C E A E D

Semantic Relatedness d(portland, Hippies) << d(portland, Monster trucks) 24

Semantic Relatedness Several measures have been proposed One that works well: Milne-Witten SR MW (, ) fraction of Wikipedia in-links to either or that link to both 25

One more distance measure Kullback Leibler divergence Related to entrop & information gain not a metric, since it is not smmetric Take EECS 428:Information Theor to find out more 31