Projects Project 4 due tonight Project 5 (last project!) out later

Slides:



Advertisements
Similar presentations
A Fast PTAS for k-Means Clustering
Advertisements

Artificial Neural Networks
Variations of the Turing Machine
3.6 Support Vector Machines
Clustering.
EE384y: Packet Switch Architectures
Constraint Satisfaction Problems
© Negnevitsky, Pearson Education, Introduction Introduction Hebbian learning Hebbian learning Generalised Hebbian learning algorithm Generalised.
1 Vorlesung Informatik 2 Algorithmen und Datenstrukturen (Parallel Algorithms) Robin Pomplun.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Author: Julia Richards and R. Scott Hawley
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Create an Application Title 1A - Adult Chapter 3.
1 Outline relationship among topics secrets LP with upper bounds by Simplex method basic feasible solution (BFS) by Simplex method for bounded variables.
Robust Window-based Multi-node Technology- Independent Logic Minimization Jeff L.Cobb Kanupriya Gulati Sunil P. Khatri Texas Instruments, Inc. Dept. of.
1 The tiling algorithm Learning in feedforward layered networks: the tiling algorithm writed by Marc M é zard and Jean-Pierre Nadal.
Introduction to Support Vector Machines (SVM)
CS525: Special Topics in DBs Large-Scale Data Management
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
Beyond Linear Separability
Local Search Jim Little UBC CS 322 – CSP October 3, 2014 Textbook §4.8
PSSA Preparation.
Essential Cell Biology
Classification Classification Examples
Lirong Xia Reinforcement Learning (2) Tue, March 21, 2014.
Lecture 9 Support Vector Machines
ECG Signal processing (2)
Unsupervised Learning Clustering K-Means. Recall: Key Components of Intelligent Agents Representation Language: Graph, Bayes Nets, Linear functions Inference.
Image classification Given the bag-of-features representations of images from different classes, how do we learn a model for distinguishing them?
Artificial Intelligence 13. Multi-Layer ANNs Course V231 Department of Computing Imperial College © Simon Colton.
Linear Classifiers (perceptrons)
Support Vector Machines
CSCI 347 / CS 4206: Data Mining Module 07: Implementations Topic 03: Linear Models.
Image classification Given the bag-of-features representations of images from different classes, how do we learn a model for distinguishing them?
CS 188: Artificial Intelligence Fall 2009
Artificial Intelligence Statistical learning methods Chapter 20, AIMA (only ANNs & SVMs)
Semi-Supervised Clustering Jieping Ye Department of Computer Science and Engineering Arizona State University
Review Rong Jin. Comparison of Different Classification Models  The goal of all classifiers Predicating class label y for an input x Estimate p(y|x)
An Introduction to Support Vector Machines Martin Law.
Collaborative Filtering Matrix Factorization Approach
This week: overview on pattern recognition (related to machine learning)
CS 8751 ML & KDDSupport Vector Machines1 Support Vector Machines (SVMs) Learning mechanism based on linear programming Chooses a separating plane based.
1 SUPPORT VECTOR MACHINES İsmail GÜNEŞ. 2 What is SVM? A new generation learning system. A new generation learning system. Based on recent advances in.
Support Vector Machines Reading: Ben-Hur and Weston, “A User’s Guide to Support Vector Machines” (linked from class web page)
Classification: Feature Vectors Hello, Do you want free printr cartriges? Why pay more when you can get them ABSOLUTELY FREE! Just # free : 2 YOUR_NAME.
Classifiers Given a feature representation for images, how do we learn a model for distinguishing features from different classes? Zebra Non-zebra Decision.
An Introduction to Support Vector Machines (M. Law)
CSSE463: Image Recognition Day 14 Lab due Weds, 3:25. Lab due Weds, 3:25. My solutions assume that you don't threshold the shapes.ppt image. My solutions.
CS 188: Artificial Intelligence Fall 2007 Lecture 25: Kernels 11/27/2007 Dan Klein – UC Berkeley.
Support vector machine LING 572 Fei Xia Week 8: 2/23/2010 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A 1.
6.S093 Visual Recognition through Machine Learning Competition Image by kirkh.deviantart.com Joseph Lim and Aditya Khosla Acknowledgment: Many slides from.
Support Vector Machines Reading: Ben-Hur and Weston, “A User’s Guide to Support Vector Machines” (linked from class web page)
Announcements  Midterm 2  Monday 4/20, 6-9pm  Rooms:  2040 Valley LSB [Last names beginning with A-C]  2060 Valley LSB [Last names beginning with.
CS 188: Artificial Intelligence Fall 2008 Lecture 24: Perceptrons II 11/24/2008 Dan Klein – UC Berkeley 1.
1 Kernel Machines A relatively new learning methodology (1992) derived from statistical learning theory. Became famous when it gave accuracy comparable.
Machine Learning Supervised Learning Classification and Regression
Fall 2004 Backpropagation CS478 - Machine Learning.
Semi-Supervised Clustering
Fun with Hyperplanes: Perceptrons, SVMs, and Friends
Artificial Intelligence
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
CS 4/527: Artificial Intelligence
Collaborative Filtering Matrix Factorization Approach
CS 188: Artificial Intelligence Spring 2007
Artificial Neural Networks
CS 188: Artificial Intelligence Fall 2008
Support Vector Machines
Machine Learning Support Vector Machine Supervised Learning
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Support Vector Machines 2
Presentation transcript:

Kernel (continued), Clustering Lirong Xia Friday, April 18, 2014

Projects Project 4 due tonight Project 5 (last project!) out later Q1: Naïve Bayes with auto tuning (for smoothing) Q2: freebie Q3: Perceptron Q4: another freebie Q5: MIRA with auto tuning (for C) Q6: feature design for Naïve Bayes

Last time Fixing the Perceptron: MIRA Support Vector Machines k-nearest neighbor (KNN)

MIRA MIRA*: choose an update size that fixes the current mistake …but, minimizes the change to w Solution *Margin Infused Relaxed Algorithm

MIRA with Maximum Step Size In practice, it’s also bad to make updates that are too large Solution: cap the maximum possible value of τ with some constant C tune C on the held-out data

Support Vector Machines Maximizing the margin: good according to intuition, theory, practice SVM

Parametric / Non-parametric Parametric models: Fixed set of parameters More data means better settings Non-parametric models: Complexity of the classifier increases with data Better in the limit, often worse in the non-limit (K)NN is non-parametric

Basic Similarity Many similarities based on feature dot products: If features are just the pixels: Note: not all similarities are of this form

Perceptron Weights What is the final value of a weight wy of a perceptron? Can it be any real vector? No! it’s build by adding up inputs Can reconstruct weight vectors (the primal representation) from update counts (the dual representation) primal dual

Dual Perceptron Start with zero counts (alpha) Pick up training instances one by one Try to classify xn, If correct, no change! If wrong: lower count of wrong class (for this instance), raise score of right class (for this instance)

Outline The kernel trick Neuron network Clustering (k-means)

Kernelized Perceptron If we had a black box (kernel) which told us the dot product of two examples x and y: Could work entirely with the dual representation No need to ever take dot products (“kernel trick”) Like nearest neighbor – work with black-box similarities Downside: slow if many examples get nonzero alpha

Kernelized Perceptron Structure

Kernels: Who Cares? So far: a very strange way of doing a very simple calculation “Kernel trick”: we can substitute many similarity function in place of the dot product Lets us learn new kinds of hypothesis

Non-Linear Separators Data that is linearly separable (with some noise) works out great: But what are we going to do if the dataset is just too hard? How about… mapping data to a higher-dimensional space: This and next few slides adapted from Ray Mooney, UT

Non-Linear Separators General idea: the original feature space can always be mapped to some higher-dimensional feature space where the training set is separable:

Some Kernels Kernels implicitly map original vectors to higher dimensional spaces, take the dot product there, and hand the result back Linear kernel: Quadratic kernel: RBF: infinite dimensional representation Mercer’s theorem: if the matrix A with Ai,j=K(xi,xj) is positive definite, then K can be represented as the inner product of a higher dimensional space

Why Kernels? Can’t you just add these features on your own? Yes, in principle, just compute them No need to modify any algorithms But, number of features can get large (or infinite) Kernels let us compute with these features implicitly Example: implicit dot product in quadratic kernel takes much less space and time per dot product Of course, there’s the cost for using the pure dual algorithms: you need to compute the similarity to every training datum

Outline The kernel trick Neuron network Clustering (k-means)

Neuron Neuron = Perceptron with a non-linear activation function ai=g(ΣjWj,iaj)

Activation function (a) step function or threshold function perceptron (b) sigmoid function 1/(1+e-x) logistic regression Does the range of g(ini) matter?

Implementation by perceptron AND, OR, and NOT can be implemented XOR cannot be implemented

Neural networks Feed-forward networks Recurrent networks single-layer (perceptrons) multi-layer (perceptrons) can represent any boolean function Learning Minimize squared error of prediction Gradient descent: backpropagation algorithm Recurrent networks Hopfield networks have symmetric weights Wi,j=Wj,i Boltzmann machines use stochastic activation functions

Feed-forward example a5=g5 (W3,5×a3+W4,5×a4) =g5 (W3,5×g3 (W1,3×a1+W2,3×a2)+W4,5×g4 (W1,4×a1+W2,4×a2))

Outline The kernel trick Neuron network Clustering (k-means)

Recap: Classification Classification systems: Supervised learning Make a prediction given evidence We’ve seen several methods for this Useful when you have labeled data

Clustering Clustering systems: Unsupervised learning Detect patterns in unlabeled data E.g. group emails or search results E.g. find categories of customers E.g. detect anomalous program executions Useful when don’t know what you’re looking for Requires data, but no labels Often get gibberish

Clustering Basic idea: group together similar instances Example: 2D point patterns What could “similar” mean? One option: small (squared) Euclidean distance

K-Means An iterative clustering algorithm Pick K random points as cluster centers (means) Alternate: Assign data instances to closest mean Assign each mean to the average of its assigned points Stop when no points’ assignments change

K-Means Example

Example: K-Means [web demo] http://www.cs.washington.edu/research/imagedatabase/ demo/kmcluster/

K-Means as Optimization Consider the total distance to the means: Each iteration reduces phi Two states each iteration: Update assignments: fix means c, change assignments a Update means: fix assignments a, change means c points assignments means

Phase I: Update Assignments For each point, re-assign to closest mean: Can only decrease total distance phi!

Phase II: Update Means Move each mean to the average of its assigned points Also can only decrease total distance…(Why?) Fun fact: the point y with minimum squared Euclidean distance to a set of points {x} is their mean

Initialization K-means is non-deterministic Requires initial means It does matter what you pick! What can go wrong? Various schemes for preventing this kind of thing: variance- based split / merge, initialization heuristics

K-Means Getting Stuck A local optimum:

K-Means Questions Will K-means converge? To a global optimum? Will it always find the true patterns in the data? If the patterns are very very clear? Will it find something interesting? Do people ever use it? How many clusters to pick?

Agglomerative Clustering First merge very similar instances Incrementally build larger clusters out of smaller clusters Algorithm: Maintain a set of clusters Initially, each instance in its own cluster Repeat: Pick the two closest clusters Merge them into a new cluster Stop when there is only one cluster left Produces not one clustering, but a family of clusterings represented by a dendrogram

Agglomerative Clustering How should we define “closest” for clusters with multiple elements? Many options Closest pair (single-link clustering) Farthest pair (complete-link clustering) Average of all pairs Ward’s method (min variance, like k-means) Different choices create different clustering behaviors

Clustering Application