{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

12-knn_perceptron

12-knn_perceptron - CS246 Mining Massive Datasets Jure...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
CS246: Mining Massive Datasets Jure Leskovec, Stanford University http://cs246.stanford.edu
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Would like to do prediction: estimate a function f(x) so that y = f(x) Where y can be: Real number : Regression Categorical : Classification Complex object: Ranking of items, Parse tree, etc. Data is labeled : Have many pairs {(x, y)} x … vector of real valued features y … class ({+1, -1}, or a real number) 2/14/2011 Jure Leskovec, Stanford C246: Mining Massive Datasets 2 X Y X’ Y’ Training and test set
Background image of page 2
We will talk about the following methods: k-Nearest Neighbor (Instance based learning) Perceptron algorithm Support Vector Machines Decision trees Main question: How to efficiently train (build a model/find model parameters) ? 2/14/2011 Jure Leskovec, Stanford C246: Mining Massive Datasets 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Instance based learning Example: Nearest neighbor Keep the whole training dataset: {(x, y)} A query example (vector) q comes Find closest example(s) x* Predict y* Can be used both for regression and classification Recommendation systems 2/14/2011 Jure Leskovec, Stanford C246: Mining Massive Datasets 4
Background image of page 4
To make Nearest Neighbor work we need 4 things: Distance metric: Euclidean How many neighbors to look at? One Weighting function (optional): Unused How to fit with the local points? Just predict the same output as the nearest neighbor 2/14/2011 Jure Leskovec, Stanford C246: Mining Massive Datasets 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Suppose x 1 ,…, x m are two dimensional: x 1 =(x 11 ,x 12 ), x 2 =(x 21 ,x 22 ), … One can draw nearest neighbor regions: 2/14/2011 Jure Leskovec, Stanford C246: Mining Massive Datasets 6 d(x i ,x j ) = (x i1 -x j1 ) 2 + (x i2 -x j2 ) 2 d(x i ,x j ) = (x i1 -x j1 ) 2 + (3x i2 -3x j2 ) 2
Background image of page 6
Distance metric: Euclidean How many neighbors to look at? k Weighting function (optional): Unused How to fit with the local points? Just predict the average output among k nearest neighbors 2/14/2011 Jure Leskovec, Stanford C246: Mining Massive Datasets 7 k=9
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Distance metric: Euclidean How many neighbors to look at? All of them (!) Weighting function: w i = exp(-d(x i , q) 2 /K w ) Nearby points to query q are weighted more strongly. K w …kernel width. How to fit with the local points? Predict weighted average: Σ w i y i / Σ w i 2/14/2011 Jure Leskovec, Stanford C246: Mining Massive Datasets 8 K=10 K=20 K=80 d(x i , q) = 0 w i
Background image of page 8
Given: a set P of n points in R d Goal: Given a query point q NN: find the nearest neighbor p of q in P Range search: find one/all points in P within distance r from q 2/14/2011 Jure Leskovec, Stanford C246: Mining Massive Datasets 9 q p
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Main memory: Linear scan Tree based: Quadtree kd-tree Hashing: Locality-Sensitive Hashing Secondary storage: R-trees 2/14/2011 Jure Leskovec, Stanford C246: Mining Massive Datasets 10
Background image of page 10
Simplest spatial structure on Earth!
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 42

12-knn_perceptron - CS246 Mining Massive Datasets Jure...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online