Steep learning curves Reading: DH&S, Ch 4.6, 4.5.

Slides:



Advertisements
Similar presentations
DECISION TREES. Decision trees  One possible representation for hypotheses.
Advertisements

Imbalanced data David Kauchak CS 451 – Fall 2013.
Data Mining Classification: Alternative Techniques
Indian Statistical Institute Kolkata
Model Assessment, Selection and Averaging
Classification and Decision Boundaries
Prof. Ramin Zabih (CS) Prof. Ashish Raj (Radiology) CS5540: Computational Techniques for Analyzing Clinical Data.
K nearest neighbor and Rocchio algorithm
Learning from Observations Chapter 18 Section 1 – 4.
By Fernando Seoane, April 25 th, 2006 Demo for Non-Parametric Classification Euclidean Metric Classifier with Data Clustering.
More Methodology; Nearest-Neighbor Classifiers Sec 4.7.
Chapter 2: Pattern Recognition
Linear methods: Regression & Discrimination Sec 4.6.
Evaluation.
Instance Based Learning. Nearest Neighbor Remember all your data When someone asks a question –Find the nearest old data point –Return the answer associated.
Slide 1 EE3J2 Data Mining Lecture 16 Unsupervised Learning Ali Al-Shahib.
Steep learning curves Reading: Bishop Ch. 3.0, 3.1.
1-NN Rule: Given an unknown sample X decide if for That is, assign X to category if the closest neighbor of X is from category i.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
Three kinds of learning
These slides are based on Tom Mitchell’s book “Machine Learning” Lazy learning vs. eager learning Processing is delayed until a new instance must be classified.
Aprendizagem baseada em instâncias (K vizinhos mais próximos)
KNN, LVQ, SOM. Instance Based Learning K-Nearest Neighbor Algorithm (LVQ) Learning Vector Quantization (SOM) Self Organizing Maps.
Decision trees and empirical methodology Sec 4.3,
1 Ensembles of Nearest Neighbor Forecasts Dragomir Yankov, Eamonn Keogh Dept. of Computer Science & Eng. University of California Riverside Dennis DeCoste.
The joy of data Plus, bonus feature: fun with differentiation Reading: DH&S Ch
The joy of Entropy.
Nearest Neighbor Classifiers other names: –instance-based learning –case-based learning (CBL) –non-parametric learning –model-free learning.
NN Cont’d. Administrivia No news today... Homework not back yet Working on it... Solution set out today, though.
Nearest-Neighbor Classifiers Sec minutes of math... Definition: a metric function is a function that obeys the following properties: Identity:
The joy of Entropy. Administrivia Reminder: HW 1 due next week No other news. No noose is good noose...
Module 04: Algorithms Topic 07: Instance-Based Learning
Methods in Medical Image Analysis Statistics of Pattern Recognition: Classification and Clustering Some content provided by Milos Hauskrecht, University.
1 1 Slide Evaluation. 2 2 n Interactive decision tree construction Load segmentchallenge.arff; look at dataset Load segmentchallenge.arff; look at dataset.
COMMON EVALUATION FINAL PROJECT Vira Oleksyuk ECE 8110: Introduction to machine Learning and Pattern Recognition.
K Nearest Neighbors Classifier & Decision Trees
Nearest Neighbor (NN) Rule & k-Nearest Neighbor (k-NN) Rule Non-parametric : Can be used with arbitrary distributions, No need to assume that the form.
Today’s Topics HW0 due 11:55pm tonight and no later than next Tuesday HW1 out on class home page; discussion page in MoodleHW1discussion page Please do.
Today Ensemble Methods. Recap of the course. Classifier Fusion
For Wednesday No reading Homework: –Chapter 18, exercise 6.
For Monday No new reading Homework: –Chapter 18, exercises 3 and 4.
Data Mining Practical Machine Learning Tools and Techniques By I. H. Witten, E. Frank and M. A. Hall Chapter 5: Credibility: Evaluating What’s Been Learned.
METU Informatics Institute Min720 Pattern Classification with Bio-Medical Applications Part 6: Nearest and k-nearest Neighbor Classification.
Weka Just do it Free and Open Source ML Suite Ian Witten & Eibe Frank University of Waikato New Zealand.
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
COMP 2208 Dr. Long Tran-Thanh University of Southampton K-Nearest Neighbour.
Machine Learning Tutorial-2. Recall, Precision, F-measure, Accuracy Ch. 5.
Chapter 13 (Prototype Methods and Nearest-Neighbors )
KNN Classifier.  Handed an instance you wish to classify  Look around the nearby region to see what other classes are around  Whichever is most common—make.
Validation methods.
Machine Learning ICS 178 Instructor: Max Welling Supervised Learning.
K nearest neighbors algorithm Parallelization on Cuda PROF. VELJKO MILUTINOVIĆ MAŠA KNEŽEVIĆ 3037/2015.
CS Machine Learning Instance Based Learning (Adapted from various sources)
Empirical Evaluation (Ch 5) how accurate is a hypothesis/model/dec.tree? given 2 hypotheses, which is better? accuracy on training set is biased – error:
Eick: kNN kNN: A Non-parametric Classification and Prediction Technique Goals of this set of transparencies: 1.Introduce kNN---a popular non-parameric.
Instance-Based Learning Evgueni Smirnov. Overview Instance-Based Learning Comparison of Eager and Instance-Based Learning Instance Distances for Instance-Based.
Data Science Credibility: Evaluating What’s Been Learned
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Lecture 05: K-nearest neighbors
Instance Based Learning (Adapted from various sources)
K Nearest Neighbor Classification
Nearest-Neighbor Classifiers
Machine Learning in Practice Lecture 26
COSC 4335: Other Classification Techniques
Nearest Neighbors CSC 576: Data Mining.
Lecture 03: K-nearest neighbors
Model generalization Brief summary of methods
CS639: Data Management for Data Science
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
ECE – Pattern Recognition Lecture 10 – Nonparametric Density Estimation – k-nearest-neighbor (kNN) Hairong Qi, Gonzalez Family Professor Electrical.
Presentation transcript:

Steep learning curves Reading: DH&S, Ch 4.6, 4.5

Administrivia HW1 due now Late days are ticking... No other news today..

Viewing and re-viewing Last time: HW1 FAQ 5 minutes of math: function optimization Measuring performance Cross-validation Today: Learning curves Metrics The nearest-neighbor rule

Exercise Given the function: Find the extremum Show that the extremum is really a minimum

Mea culpa! I copied the wrong example out of the book. Oops. My bad. You guys did a great job figuring it out, though...

The saddle point

Cross-validation in words Shuffle data vectors Break into k chunks Train on first k-1 chunks Test on last 1 Repeat, with a different chunk held-out Average all test accuracies together

CV in pix [X;y][X;y] Original data [X’;y’] Random shuffle k -way partition [X1’ Y1’] [X2’ Y2’] [Xk’ Yk’]... k train/ test sets k accuracies 53.7%85.1%73.2%

But is it really learning? Now we know how well our models are performing But are they really learning? Maybe any classifier would do as well E.g., a default classifier (pick the most likely class) or a random classifier How can we tell if the model is learning anything?

The learning curve Train on successively larger fractions of data Watch how accuracy (performance) changes Learning Static classifier (no learning) Anti-learning (forgetting)

Measuring variance Cross validation helps you get better estimate of accuracy for small data Randomization (shuffling the data) helps guard against poor splits/ordering of the data Learning curves help assess learning rate/asymptotic accuracy Still one big missing component: variance Definition: Variance of a classifier is the fraction of error due to the specific data set it’s trained on

Measuring variance Variance tells you how much you expect your classifier/performance to change when you train it on a new (but similar) data set E.g., take 5 samplings of a data source; train/test 5 classifiers Accuracies: 74.2, 90.3, 58.1, 80.6, 90.3 Mean accuracy: 78.7% Std dev of acc: 13.4% Variance is usually a function of both classifier and data source High variance classifiers are very susceptible to small changes in data

Putting it all together Suppose you want to measure the expected accuracy of your classifier, assess learning rate, and measure variance all at the same time? for (i=0;i<10;++i) { // variance reps shuffle data do 10-way CV partition of data for each train/test partition { // xval for (pct=0.1;pct+=0.1;pct<=0.9) { // LC Subsample pct fraction of training set train on subsample, test on test set } avg across all folds of CV partition generate learning curve for this partition } get mean and std across all curves

Putting it all together “hepatitis” data

5 minutes of math... Decision trees are non-metric Don’t know anything about relations between instances, except sets induced by feature splits Often, we have well-defined distances between points Idea of distance encapsulated by a metric

5 minutes of math... Definition: a metric function is a function that obeys the following properties: 1. Non-negativity: 2. Reflexivity: 3. Symmetry: 4. Triangle inequality:

5 minutes of math... Euclidean distance

5 minutes of math xaxa xbxb dE(xa,xb)dE(xa,xb)

5 minutes of math... Manhattan (taxicab) distance Distance travelled along a grid between two points No diagonals allowed Good for integer features

5 minutes of math xaxa xbxb dM(xa,xb)dM(xa,xb)

5 minutes of math... What if some attribute is categorical?

5 minutes of math... What if some attribute is categorical? Typical answer is Hamming (sometimes 0/1 ) distance: For each attribute, add 1 if the instances differ in that attribute, else 0

Distances in classification Nearest neighbor rule: find the nearest instance to the query point in feature space, return the class of that instance Simplest possible distance-based classifier With more notation:

Distances in classification Nearest neighbor rule: find the nearest instance to the query point in feature space, return the class of that instance Simplest possible distance-based classifier With more notation: Distance here is “whatever’s appropriate to your data”

Properties of NN Training time of NN? Classification time? Geometry of model? d(, ) Closer to

Properties of NN Training time of NN? Classification time? Geometry of model?

Properties of NN Training time of NN? Classification time? Geometry of model?

NN miscellaney Slight generalization: k -Nearest neighbors ( k -NN) Find k training instances closest to query point Vote among them for label Q : How does this affect system?