Perceptrons Lirong Xia.

Slides:



Advertisements
Similar presentations
Classification Classification Examples
Advertisements

Artificial Neural Networks (1)
CPSC 502, Lecture 15Slide 1 Introduction to Artificial Intelligence (AI) Computer Science cpsc502, Lecture 15 Nov, 1, 2011 Slide credit: C. Conati, S.
Linear Classifiers (perceptrons)
Machine learning continued Image source:
CS 188: Artificial Intelligence Spring 2007 Lecture 19: Perceptrons 4/2/2007 Srini Narayanan – ICSI and UC Berkeley.
Ensemble Learning: An Introduction
Introduction to Machine Learning course fall 2007 Lecturer: Amnon Shashua Teaching Assistant: Yevgeny Seldin School of Computer Science and Engineering.
CS 188: Artificial Intelligence Fall 2009 Lecture 23: Perceptrons 11/17/2009 Dan Klein – UC Berkeley TexPoint fonts used in EMF. Read the TexPoint manual.
Bayes Classifier, Linear Regression 10701/15781 Recitation January 29, 2008 Parts of the slides are from previous years’ recitation and lecture notes,
The classification problem (Recap from LING570) LING 572 Fei Xia, Dan Jinguji Week 1: 1/10/08 1.
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)
Machine learning Image source:
CSCI 347 / CS 4206: Data Mining Module 04: Algorithms Topic 06: Regression.
Crash Course on Machine Learning
Machine learning Image source:
Neural Networks Lecture 8: Two simple learning algorithms
Classification III Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell,
MULTICLASS CONTINUED AND RANKING David Kauchak CS 451 – Fall 2013.
1 Logistic Regression Adapted from: Tom Mitchell’s Machine Learning Book Evan Wei Xiang and Qiang Yang.
8/25/05 Cognitive Computations Software Tutorial Page 1 SNoW: Sparse Network of Winnows Presented by Nick Rizzolo.
Support Vector Machines Mei-Chen Yeh 04/20/2010. The Classification Problem Label instances, usually represented by feature vectors, into one of the predefined.
CSE 446 Perceptron Learning Winter 2012 Dan Weld Some slides from Carlos Guestrin, Luke Zettlemoyer.
Classification: Feature Vectors
Data Mining Practical Machine Learning Tools and Techniques Chapter 4: Algorithms: The Basic Methods Section 4.6: Linear Models Rodney Nielsen Many of.
Linear Discrimination Reading: Chapter 2 of textbook.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Image Recognition COMP # 18.
Slides for “Data Mining” by I. H. Witten and E. Frank.
Machine Learning  Up until now: how to reason in a model and how to make optimal decisions  Machine learning: how to acquire a model on the basis of.
Classification (slides adapted from Rob Schapire) Eran Segal Weizmann Institute.
Naïve Bayes Classification Material borrowed from Jonathan Huang and I. H. Witten’s and E. Frank’s “Data Mining” and Jeremy Wyatt and others.
Regress-itation Feb. 5, Outline Linear regression – Regression: predicting a continuous value Logistic regression – Classification: predicting a.
CSE 446 Logistic Regression Perceptron Learning Winter 2012 Dan Weld Some slides from Carlos Guestrin, Luke Zettlemoyer.
Linear Models & Clustering Presented by Kwak, Nam-ju 1.
Naïve Bayes Classification Recitation, 1/25/07 Jonathan Huang.
Ensemble Classifiers.
Neural networks and support vector machines
Matt Gormley Lecture 3 September 7, 2016
Machine Learning – Classification David Fenyő
Evaluating Classifiers
Dan Roth Department of Computer and Information Science
Artificial Intelligence
Naïve Bayes Classifiers
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
CS 188: Artificial Intelligence Fall 2006
Artificial Intelligence
Perceptrons Lirong Xia.
Classification with Perceptrons Reading:
CS 188: Artificial Intelligence Fall 2008
CS 188: Artificial Intelligence
Perceptron Learning Demonstration
CS 4/527: Artificial Intelligence
Support Vector Machines
CS 188: Artificial Intelligence
Chapter 3. Artificial Neural Networks - Introduction -
دسته بندی با استفاده از مدل های خطی
Neural Networks.
CS480/680: Intro to ML Lecture 01: Perceptron 9/11/18 Yao-Liang Yu.
Artificial Intelligence Lecture No. 28
CS 188: Artificial Intelligence Spring 2006
Speech recognition, machine learning
Artificial Intelligence 9. Perceptron
CS 188: Artificial Intelligence
Naïve Bayes Classifiers
Perceptron Learning Rule
Introduction to Neural Networks
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Perceptron Learning Rule
Support Vector Machines 2
Speech recognition, machine learning
Presentation transcript:

Perceptrons Lirong Xia

Classification Classification Examples Given inputs x, predict labels (classes) y Examples Spam detection. input: documents; classes: spam/ham OCR. input: images; classes: characters Medical diagnosis. input: symptoms; classes: diseases Autograder. input: codes; output: grades

Important Concepts Data: labeled instances, e.g. emails marked spam/ham Training set Held out set (we will give examples today) Test set Features: attribute-value pairs that characterize each x Experimentation cycle Learn parameters (e.g. model probabilities) on training set (Tune hyperparameters on held-out set) Compute accuracy of test set Very important: never “peek” at the test set! Evaluation Accuracy: fraction of instances predicted correctly Overfitting and generalization Want a classifier which does well on test data Overfitting: fitting the training data very closely, but not generalizing well

General Naive Bayes A general naive Bayes model: We only specify how each feature depends on the class Total number of parameters is linear in n

Tuning on Held-Out Data Now we’ve got two kinds of unknowns Parameters: the probabilities p(Y|X), p(Y) Hyperparameters, like the amount of smoothing to do: k,α Where to learn? Learn parameters from training data For each value of the hyperparameters, train and test on the held-out data Choose the best value and do a final test on the test data

Today’s schedule Binary Linear Classifiers Perceptron Multi-class Linear Classifiers Multi-class Perceptron

Classification: Feature Vectors

Outline Binary Linear Classifiers Perceptron Multi-class Linear Classifiers Multi-class Perceptron

Some (Simplified) Biology Very loose inspiration: human neurons

Linear Classifiers Inputs are feature values Each feature has a weight Sum is the activation If the activation is: Positive: output +1 Negative, output -1

Classification: Weights Binary case: compare features to a weight vector Learning: figure out the weight vector from examples

Linear classifiers Mini Exercise 1.Draw the 3 feature vectors and the weight vector w 2.Which feature vectors are classified as +? As -? 3.Draw the line separating feature vectors being classified + and -.

Linear classifiers Mini Exercise 2---Bias Term 1.Draw the 4 feature vectors and the weight vector w 2.Which feature vectors are classified as +? As -? 3.Draw the line separating feature vectors being classified + and -.

Linear classifiers Mini Exercise 3---adding features 1.Draw the 4 1-dimensional feature vectors f(x1)=-2, f(x2)=-1, f(x3)=1, f(x4)=2 2.Is there a separating vector w that classifies x1 and x4 as +1 and classifies x2 and x3 as -1? 3. can you add one more feature to make this happen?

Binary Decision Rule In the space of feature vectors Examples are points Any weight vector is a hyperplane One side corresponds to Y = +1 Other corresponds to Y = -1

Outline Generative vs. Discriminative Binary Linear Classifiers Perceptron: how to find the weight vector w from data. Multi-class Linear Classifiers Multi-class Perceptron

Learning: Binary Perceptron Start with weights = 0 For each training instance: Classify with current weights If correct (i.e. y=y*), no change! If wrong: adjust the weight vector by adding or subtracting the feature vector. Subtract if y* is -1.

Outline Generative vs. Discriminative Binary Linear Classifiers Perceptron Multi-class Linear Classifiers Multi-class Perceptron

Multiclass Decision Rule If we have multiple classes: A weight vector for each class: Score (activation) of a class y: Prediction highest score wins Binary = multiclass where the negative class has weight zero

Example Exercise --- Which Category is Chosen? “win the vote”

Exercise: Multiclass linear classifier for 2 classes and binary linear classifier Consider the multiclass linear classifier for two classes with Is there an equivalent binary linear classifier, i.e., one that classifies all points x = (x1,x2) the same way?

Outline Generative vs. Discriminative Binary Linear Classifiers Perceptron Multi-class Linear Classifiers Multi-class Perceptron: learning the weight vectors wi from data

Learning: Multiclass Perceptron Start with all weights = 0 Pick up training examples one by one Predict with current weights If correct, no change! If wrong: lower score of wrong answer, raise score of right answer

Example: Multiclass Perceptron “win the vote” “win the game”