Classification Classification Examples

Slides:



Advertisements
Similar presentations
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 5 Author: Julia Richards and R. Scott Hawley.
Advertisements

1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
Chapter R: Reference: Basic Algebraic Concepts
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
ADDING INTEGERS 1. POS. + POS. = POS. 2. NEG. + NEG. = NEG. 3. POS. + NEG. OR NEG. + POS. SUBTRACT TAKE SIGN OF BIGGER ABSOLUTE VALUE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Year 6 mental test 5 second questions
BALANCING 2 AIM: To solve equations with variables on both sides.
ZMQS ZMQS
Solve Multi-step Equations
Koby Crammer Department of Electrical Engineering
Projects Project 4 due tonight Project 5 (last project!) out later
ABC Technology Project
CHAPTER 6 Introduction to Graphing and Statistics Slide 2Copyright 2012, 2008, 2004, 2000 Pearson Education, Inc. 6.1Tables and Pictographs 6.2Bar Graphs.
1 Computation in neural networks M. Meeter. 2 Perceptron learning problem Input Patterns Desired output [+1, +1, -1, -1] [+1, -1, +1] [-1, -1, +1, +1]
Text Categorization.
Squares and Square Root WALK. Solve each problem REVIEW:
Machine Learning: Intro and Supervised Classification
Chapter 5 Test Review Sections 5-1 through 5-4.
Chapter 7 Classification and Regression Trees
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Princess Nora University Artificial Intelligence Artificial Neural Network (ANN) 1.
Test B, 100 Subtraction Facts
Week 1.
We will resume in: 25 Minutes.
How Cells Obtain Energy from Food
Oct 9, 2014 Lirong Xia Hypothesis testing and statistical decision theory.
Nov 7, 2013 Lirong Xia Hypothesis testing and statistical decision theory.
Basics of Statistical Estimation
Information Extraction Lecture 7 – Linear Models (Basic Machine Learning) CIS, LMU München Winter Semester Dr. Alexander Fraser, CIS.
Particle Filtering Sometimes |X| is too big to use exact inference
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)
CS 188: Artificial Intelligence Spring 2007 Lecture 19: Perceptrons 4/2/2007 Srini Narayanan – ICSI and UC Berkeley.
Ensemble Learning: An Introduction
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.
Machine learning Image source:
CSCI 347 / CS 4206: Data Mining Module 04: Algorithms Topic 06: Regression.
Machine learning Image source:
Neural Networks Lecture 8: Two simple learning algorithms
8/25/05 Cognitive Computations Software Tutorial Page 1 SNoW: Sparse Network of Winnows Presented by Nick Rizzolo.
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.
Artificial Intelligence
Naïve Bayes Classifiers
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Perceptrons Lirong Xia.
CS 4/527: Artificial Intelligence
Support Vector Machines
CS 188: Artificial Intelligence
CS 188: Artificial Intelligence Spring 2006
Speech recognition, machine learning
Artificial Intelligence 9. Perceptron
CS 188: Artificial Intelligence
Naïve Bayes Classifiers
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Perceptrons Lirong Xia.
Speech recognition, machine learning
Presentation transcript:

Perceptrons Lirong Xia Friday, April 11, 2014

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 Generative vs. Discriminative Binary Linear Classifiers Perceptron Multi-class Linear Classifiers Multi-class Perceptron

Classification: Feature Vectors

Generative vs. Discriminative Generative classifiers: E.g. naive Bayes A causal model with evidence variables Query model for causes given evidence Discriminative classifiers: No causal model, no Bayes rule, often no probabilities at all! Try to predict the label Y directly from X Robust, accurate with varied features Loosely: mistake driven rather than model driven

Outline Generative vs. Discriminative 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 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 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 election” “win the game”