Machine Learning. Cross Validation

Similar documents
Assignment No: 2. Assessment as per Schedule. Specifications Readability Assignments

LECTURE 6: CROSS VALIDATION

A Study of Cross-Validation and Bootstrap for Accuracy Estimation and Model Selection (Kohavi, 1995)

How do we obtain reliable estimates of performance measures?

Cross- Valida+on & ROC curve. Anna Helena Reali Costa PCS 5024

RESAMPLING METHODS. Chapter 05

Cross-validation. Cross-validation is a resampling method.

ECLT 5810 Evaluation of Classification Quality

Performance Estimation and Regularization. Kasthuri Kannan, PhD. Machine Learning, Spring 2018

Bias-Variance Decomposition Error Estimators

Bias-Variance Decomposition Error Estimators Cross-Validation

Multicollinearity and Validation CIVL 7012/8012

Cross-validation for detecting and preventing overfitting

Machine Learning and Bioinformatics 機器學習與生物資訊學

Lecture 7. CS4442/9542b: Artificial Intelligence II Prof. Olga Veksler. Outline. Machine Learning: Cross Validation. Performance evaluation methods

Statistical Consulting Topics Using cross-validation for model selection. Cross-validation is a technique that can be used for model evaluation.

CS4491/CS 7265 BIG DATA ANALYTICS

Classification Part 4

Machine Learning Techniques for Data Mining

Cross-validation for detecting and preventing overfitting

Cross-validation for detecting and preventing overfitting

Nonparametric Methods Recap

COMPUTATIONAL INTELLIGENCE SEW (INTRODUCTION TO MACHINE LEARNING) SS18. Lecture 6: k-nn Cross-validation Regularization

Evaluating Classifiers

Model Complexity and Generalization

CS435 Introduction to Big Data Spring 2018 Colorado State University. 3/21/2018 Week 10-B Sangmi Lee Pallickara. FAQs. Collaborative filtering

2017 ITRON EFG Meeting. Abdul Razack. Specialist, Load Forecasting NV Energy

Regularization and model selection

Simple Model Selection Cross Validation Regularization Neural Networks

CPSC 340: Machine Learning and Data Mining

Data Mining: Classifier Evaluation. CSCI-B490 Seminar in Computer Science (Data Mining)

Model validation T , , Heli Hiisilä

CSE 446 Bias-Variance & Naïve Bayes

The Basics of Decision Trees

I211: Information infrastructure II

Boosting Simple Model Selection Cross Validation Regularization

Algorithms: Decision Trees

Data Mining Lecture 8: Decision Trees

10601 Machine Learning. Model and feature selection

Model Assessment and Selection. Reference: The Elements of Statistical Learning, by T. Hastie, R. Tibshirani, J. Friedman, Springer

CS249: ADVANCED DATA MINING

IOM 530: Intro. to Statistical Learning 1 RESAMPLING METHODS. Chapter 05

Evaluating Machine-Learning Methods. Goals for the lecture

Overfitting. Machine Learning CSE546 Carlos Guestrin University of Washington. October 2, Bias-Variance Tradeoff

Principles of Machine Learning

CPSC 340: Machine Learning and Data Mining. Probabilistic Classification Fall 2017

Sample 1. Dataset Distribution F Sample 2. Real world Distribution F. Sample k

Boosting Simple Model Selection Cross Validation Regularization. October 3 rd, 2007 Carlos Guestrin [Schapire, 1989]

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

Lecture 3: Linear Classification

Tree-based methods for classification and regression

Lecture 7. Memory Management

Leveling Up as a Data Scientist. ds/2014/10/level-up-ds.jpg

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

Evaluating Machine Learning Methods: Part 1

More on Neural Networks. Read Chapter 5 in the text by Bishop, except omit Sections 5.3.3, 5.3.4, 5.4, 5.5.4, 5.5.5, 5.5.6, 5.5.7, and 5.

Metrics for Performance Evaluation How to evaluate the performance of a model? Methods for Performance Evaluation How to obtain reliable estimates?

Classification. Instructor: Wei Ding

Random Forests and Boosting

Model selection and validation 1: Cross-validation

CSC411/2515 Tutorial: K-NN and Decision Tree

Cross-validation and the Bootstrap

3 Virtual attribute subsetting

Operating Systems 2230

CSE446: Linear Regression. Spring 2017

Machine Learning: An Applied Econometric Approach Online Appendix

Machine Learning Techniques for Data Mining

Combine the PA Algorithm with a Proximal Classifier

CS178: Machine Learning and Data Mining. Complexity & Nearest Neighbor Methods

Slides for Data Mining by I. H. Witten and E. Frank

1.1 The Real Number System

PARAMETER OPTIMIZATION FOR AUTOMATED SIGNAL ANALYSIS FOR CONDITION MONITORING OF AIRCRAFT SYSTEMS. Mike Gerdes 1, Dieter Scholz 1

Building Classifiers using Bayesian Networks

What is Learning? CS 343: Artificial Intelligence Machine Learning. Raymond J. Mooney. Problem Solving / Planning / Control.

School of Computer and Information Science

Tutorial on Machine Learning Tools

Tutorial Case studies

LECTURE 12: LINEAR MODEL SELECTION PT. 3. October 23, 2017 SDS 293: Machine Learning

CS 584 Data Mining. Classification 3

OVERVIEW & RECAP COLE OTT MILESTONE WRITEUP GENERALIZABLE IMAGE ANALOGIES FOCUS

Natural Language Processing CS 6320 Lecture 6 Neural Language Models. Instructor: Sanda Harabagiu

Using Genetic Algorithms to Solve the Box Stacking Problem

Hyperparameter optimization. CS6787 Lecture 6 Fall 2017

RAID SEMINAR REPORT /09/2004 Asha.P.M NO: 612 S7 ECE

CITS4009 Introduction to Data Science

The Problem of Overfitting with Maximum Likelihood

7. Decision or classification trees

Statistics: Normal Distribution, Sampling, Function Fitting & Regression Analysis (Grade 12) *

Four equations are necessary to evaluate these coefficients. Eqn

Random Search Report An objective look at random search performance for 4 problem sets

Identifying Important Communications

A Study for Branch Predictors to Alleviate the Aliasing Problem

Cross-validation and the Bootstrap

Lecture 25: Review I

10 Classification: Evaluation

Big Data Methods. Chapter 5: Machine learning. Big Data Methods, Chapter 5, Slide 1

Lecture 13: Model selection and regularization

CS 31: Intro to Systems Caching. Kevin Webb Swarthmore College March 24, 2015

Random Forest A. Fornaser

Ranking Clustered Data with Pairwise Comparisons

Transcription:

Machine Learning Cross Validation

Cross Validation Cross validation is a model evaluation method that is better than residuals. The problem with residual evaluations is that they do not give an indication of how well the learner will do when it is asked to make new predictions for data it has not already seen. One way to overcome this problem is to.. not use the entire data set when training a learner. Some of the data is removed before training begins. Then when training is done, the data that was removed can be used to test the performance of the learned model on ``new'' data. This is the basic idea for a whole class of model evaluation methods called cross validation. 2

3

4

5

The holdout method The holdout method is the simplest kind of cross validation. The data set is separated into two sets, called the training set and the testing set. The function approximator fits a function using the training set only. Then the function approximator is asked to predict the output values for the data in the testing set (it has never seen these output values before). 6

Chapter 7 7

8

9

10

11

12

13

14

The holdout method The errors it makes are accumulated as before to give the mean absolute test set error, which is used to evaluate the model. The advantage of this method is that it is usually preferable to the residual method and takes no longer to compute. However, its evaluation can have a high variance. The evaluation may depend heavily on which data points end up in the training set and which end up in the test set, the evaluation may be significantly different depending on how the division is made. 15

Leave-one-out cross validation Leave-one-out cross validation (LOOCV) is K-fold cross validation taken to its logical extreme, with K equal to N, the number of data points in the set. That means that N separate times, the function approximator is trained on all the data except for one point and a prediction is made for that point. As before the average error is computed and used to evaluate the model. 16

17

18

19

20

21

22

23

24

Leave-one-out cross validation The evaluation given by leave-one-out cross validation error (LOO-CVE) is good, but at first pass it seems very expensive to compute. Fortunately, locally weighted learners can make LOO predictions just as easily as they make regular predictions. That means computing the LOO-CVE takes no more time than computing the residual error and it is a much better way to evaluate models. 25

K-fold cross validation K-fold cross validation is one way to improve over the holdout method. The data set is divided into k subsets, and the holdout method is repeated k times. Each time, one of the k subsets is used as the test set and the other k-1 subsets are put together to form a training set. Then the average error across all k trials is computed. The advantage of this method is that it matters less how the data gets divided. Every data point gets to be in a test set exactly once, and gets to be in a training set k-1 times. 26

27

28

29

30

31

32

33

K-fold cross validation The variance of the resulting estimate is reduced as k is increased. The disadvantage of this method is that the training algorithm has to be rerun from scratch k times, which means it takes k times as much computation to make an evaluation. A variant of this method... is to... randomly divide the data into a test and training set k different times. The advantage of doing this is that you can independently choose how large each test set is and how many trials you average over. 34

Which kind of Cross Validation? Test-set Leave-oneout 10-fold 3-fold R-fold Downside Variance: unreiable estimate of future perfomance Expensive. Has some weird behavior Wastes 10% of the data. 10 times more expensive tan test set Wastier tan 10-fold. Expensivier tan test set Identical to Leave-one-out Upside Cheap Doesn t waste data Only wastes 10%. Only 10 times more expensive instead of R times Slightly better tan test-set 35

36

For classification problems, one typically uses stratified k-fold cross-validation, in which the folds are selected so that each fold contains roughly the same proportions of class labels. In repeated cross-validation, the cross-validation procedure is repeated n times, yielding n random partitions of the original sample. The n results are again averaged (or otherwise combined) to produce a single estimation. 37

Now, one of most commonly asked question is, How to choose right value of k? Always remember, lower value of K is more biased and hence undesirable. On the other hand, higher value of K is less biased, but can suffer from large variability. It is good to know that, smaller value of k always takes us towards validation set approach, where as higher value of k leads to LOOCV approach. Hence, it is often suggested to use k=10. 38

How to measure the model s bias-variance? After k-fold cross validation, we ll get k different model estimation errors (e1, e2..ek). In ideal scenario, these error values should add to zero. To return the model s bias, we take the average of all the errors. Lower the average value, better the model. Similarly for calculating model variance, we take standard deviation of all errors. Lower value of standard deviation suggests our model does not vary a lot with different subset of training data. We should focus on achieving a balance between bias and variance. This can be done by reducing the variance and controlling bias to an extent. It ll result in better predictive model. This trade-off usually leads to building less complex predictive models. 39