Resampling techniques for statistical modeling

Similar documents
MS&E 226: Small Data

PDEEC Machine Learning 2016/17

VC dimension, Model Selection and Performance Assessment for SVM and Other Machine Learning Algorithms

Holdout and Cross-Validation Methods Overfitting Avoidance

Bioinformatics: Network Analysis

Introduction to Statistical modeling: handout for Math 489/583

Hypothesis Evaluation

epochs epochs

ISyE 691 Data mining and analytics

Chapter ML:II (continued)

CSE 417T: Introduction to Machine Learning. Final Review. Henry Chai 12/4/18

Performance Evaluation and Comparison

Estimating the accuracy of a hypothesis Setting. Assume a binary classification setting

2.2 Classical Regression in the Time Series Context

An Introduction to Statistical Machine Learning - Theoretical Aspects -

Machine Learning CSE546 Carlos Guestrin University of Washington. September 30, 2013

STAT 535 Lecture 5 November, 2018 Brief overview of Model Selection and Regularization c Marina Meilă

Performance Evaluation

Feature selection and extraction Spectral domain quality estimation Alternatives

Applied Machine Learning Annalisa Marsico

Introduction to Supervised Learning. Performance Evaluation

Modèles stochastiques II

Classification. Chapter Introduction. 6.2 The Bayes classifier

Sample questions for Fundamentals of Machine Learning 2018

Confidence Estimation Methods for Neural Networks: A Practical Comparison

MS-C1620 Statistical inference

Bootstrap for model selection: linear approximation of the optimism

Look before you leap: Some insights into learner evaluation with cross-validation

Econometric Forecasting

9. Model Selection. statistical models. overview of model selection. information criteria. goodness-of-fit measures

10-701/ Machine Learning, Fall

Final Overview. Introduction to ML. Marek Petrik 4/25/2017

Final Review. Yang Feng. Yang Feng (Columbia University) Final Review 1 / 58

Direct Learning: Linear Regression. Donglin Zeng, Department of Biostatistics, University of North Carolina

Lecture 3: Introduction to Complexity Regularization

Diagnostics. Gad Kimmel

Machine Learning for OR & FE

Stats notes Chapter 5 of Data Mining From Witten and Frank

Linear Regression. Machine Learning CSE546 Kevin Jamieson University of Washington. Oct 5, Kevin Jamieson 1

Dimensionality Reduction Techniques (DRT)

Machine Learning CSE546 Sham Kakade University of Washington. Oct 4, What about continuous variables?

Machine Learning CSE546 Carlos Guestrin University of Washington. September 30, What about continuous variables?

STK-IN4300 Statistical Learning Methods in Data Science

Advances in Extreme Learning Machines

Fundamentals of Machine Learning. Mohammad Emtiyaz Khan EPFL Aug 25, 2015

Machine Learning. Lecture 9: Learning Theory. Feng Li.

Methods and Criteria for Model Selection. CS57300 Data Mining Fall Instructor: Bruno Ribeiro

Remedial Measures for Multiple Linear Regression Models

Computational statistics

Analysis of Fast Input Selection: Application in Time Series Prediction

Econometric Methods. Prediction / Violation of A-Assumptions. Burcu Erdogan. Universität Trier WS 2011/2012

Abstract. Keywords. Notations

Tutorial on Machine Learning for Advanced Electronics

Cross-Validation with Confidence

Chapter 7: Model Assessment and Selection

Econ 582 Nonparametric Regression

ECE521 week 3: 23/26 January 2017

Data Mining: Concepts and Techniques. (3 rd ed.) Chapter 8. Chapter 8. Classification: Basic Concepts

Fundamentals of Machine Learning (Part I)

CSE446: Linear Regression Regulariza5on Bias / Variance Tradeoff Winter 2015

interval forecasting

Testing and Model Selection

Dr. Maddah ENMG 617 EM Statistics 11/28/12. Multiple Regression (3) (Chapter 15, Hines)

STK-IN4300 Statistical Learning Methods in Data Science

Statistical Machine Learning from Data

11. Bootstrap Methods

Feature selection and classifier performance in computer-aided diagnosis: The effect of finite sample size

Akaike Information Criterion

Cross-validation for detecting and preventing overfitting

This model of the conditional expectation is linear in the parameters. A more practical and relaxed attitude towards linear regression is to say that

STAT Financial Time Series

Model Selection. Frank Wood. December 10, 2009

Empirical Risk Minimization, Model Selection, and Model Assessment

STATS 200: Introduction to Statistical Inference. Lecture 29: Course review

Machine Learning Linear Regression. Prof. Matteo Matteucci

Regression, Ridge Regression, Lasso

Model Selection Tutorial 2: Problems With Using AIC to Select a Subset of Exposures in a Regression Model

Summary of Chapter 7 (Sections ) and Chapter 8 (Section 8.1)

ESANN'2003 proceedings - European Symposium on Artificial Neural Networks Bruges (Belgium), April 2003, d-side publi., ISBN X, pp.

Model Identification in Wavelet Neural Networks Framework

Outline Introduction OLS Design of experiments Regression. Metamodeling. ME598/494 Lecture. Max Yi Ren

Chapter 3: Regression Methods for Trends

Linear Regression. CSL603 - Fall 2017 Narayanan C Krishnan

Linear Regression. CSL465/603 - Fall 2016 Narayanan C Krishnan

Bootstrap, Jackknife and other resampling methods

Chapter 14 Stein-Rule Estimation

MGR-815. Notes for the MGR-815 course. 12 June School of Superior Technology. Professor Zbigniew Dziong

COMP 551 Applied Machine Learning Lecture 3: Linear regression (cont d)

High-dimensional regression

Lecture 4: Types of errors. Bayesian regression models. Logistic regression

6.867 Machine Learning

Fundamentals of Machine Learning

cxx ab.ec Warm up OH 2 ax 16 0 axtb Fix any a, b, c > What is the x 2 R that minimizes ax 2 + bx + c

Resampling-Based Information Criteria for Adaptive Linear Model Selection

Cross-Validation with Confidence

EM-algorithm for Training of State-space Models with Application to Time Series Prediction

Introduction to Machine Learning and Cross-Validation

Linear Regression Models. Based on Chapter 3 of Hastie, Tibshirani and Friedman

Bootstrapping Heteroskedasticity Consistent Covariance Matrix Estimator

SCMA292 Mathematical Modeling : Machine Learning. Krikamol Muandet. Department of Mathematics Faculty of Science, Mahidol University.

Transcription:

Resampling techniques for statistical modeling Gianluca Bontempi Département d Informatique Boulevard de Triomphe - CP 212 http://www.ulb.ac.be/di Resampling techniques p.1/33

Beyond the empirical error Empirical error tend to be a too optimistic estimate of the true prediction error. The reason is that we are using the same data to assess the model as were used to fit it using parameter estimates that are fine-tuned to our particular data set. In other words the test sample is the same as the original sample sometimes called also the training sample. Estimates of prediction error obtained in this way are called apparent error estimates. Resampling techniques p.2/33

The linear case: MISE error Let us compute now the expected prediction error of a linear model trained on but inputs law training linear same same the the for to predict to according used is this distributed when a set of outputs. We call this quantity Mean Integrated independent of the training output Squared Error MISE (1) $ %!#" Since & (2) ) (& ) (& Resampling techniques p.3/33

- we have (& (& * $ %! " $ $ %!#" tr +! $ % " * * $ %! " (3) Then we obtain that the residual sum of squares estimate of MISE that is SSE emp returns a biased SSE emp / -.- MISE(4) As a consequence if we replace the residual sum of squares with + $ % 0 " - (5) we obtain an unbiased estimator. Nevertheless this estimator requires an estimate of the noise variance. Resampling techniques p.4/33

21 4 3 + " +! 6 + 4 1 5! 6 + 4! The PSE and the FPE Given an a priori estimate criterion $ %we have the Predicted Square Error (PSE) " SSE emp + $ % 0 " where is the total number of model parameters. Taking as estimate of 4! $ % $ % " SSE emp we have the Final Prediction Error (FPE) SSE emp Note that in order to have an estimate of the MSE error it is sufficient to divide the above statistics by. Resampling techniques p.5/33

The AIC criterion The Akaike Information Criterion (AIC) is commonly used to assess and select among a set of models on the basis of the likelihood. AIC was introduced by Akaike in 1973. He shows that the maximum log likelihood is a biased estimator of the mean expected log likelihood. In other terms the maximum log likelihood has a general tendency to overestimate the true value of the mean expected log likelihood. This tendency is more prominent for models with a larger number of free parameters. In other terms if we choose the model with the largest maximum log likelihood a model with an unnecessarily large number of free parameters is likely to be chosen. Resampling techniques p.6/33

= 3 < The AIC criterion (II) Consider a training set probability distribution variable and BC @?A <?> generated according to the parametric where is a continuous random < :9 ; +87. We assume that there are no constraints on the parameters i.e. the number of free parameters in the model is. The maximum likelihood approach consists in returning an estimate of on the basis of the training set. The estimate is < ml < M DHJIK L FG DE where < M is the empirical log-likelihood < N :9 ; QRS 4! NPO < M Resampling techniques p.7/33

M M M + M + M! The AIC criterion (III) We define with < UT; + 7 ml < ml the expected log-likelihood of the distribution < ml V :9+ W 9 < QR + 9 ; 7 ml The quantity < 9 ; ml < ml as estimator of is negative and represents the accuracy of. :9+ 7 Therefore the larger the value of approximation of :9+ returned by < ml < 9 ; the better is the The maximum likelihood analogous of the mean integrated squared error is the mean expected log-likelihood ml. Y M X ml V < ml 1 W that is the average over all possible realizations of a dataset of size. Resampling techniques p.8/33

@ S 1 The AIC criterion (IV) The Akaike s criterion is based on the following assumption: there exists a value so that the probability model is equal to the underlying distribution. <Z> :9 Under this assumption he shows that the quantity Z< :9 ; AIC < M ml 3! (6) is an unbiased estimate of the mean expected log-likelihood. A model which minimizes appropriate model. AIC is considered to be the most When there are several models whose values of maximum likelihood are about the same level we should choose the one with the smallest number of free parameters. In this sense AIC realizes the so called principle of parsimony. Resampling techniques p.9/33

The non-linear case The above results hold only for the linear case. Note that linear case means that the phenomenon underlying the data is linear not simply that the model is linear. In other terms so far we assumed that the bias of the model was null. The corrective terms of FPE and PSE aimed at correcting the wrong estimation of the variance returned by the empirical error. How to measure MSE in a reliable way in the non-linear case starting from a finite dataset? The simplest approach is to extend the linear measures to the nonlinear case. Resampling techniques p.10/33

$ $ The [ statistic Another estimate of the prediction error is the \^] statistic $ 0+ "! $ N! N NPO \ ] where " is an estimate of the residual variance. A reasonable choice for is " ]. edc`b _a`b& & NPO Note that this statistic is the nonlinear version of the PSE criterion. It was derived for linear smoothers a class of approximators which includes also linear models. An alternative is represented by validation methods. Resampling techniques p.11/33

!!! f f g Validation techniques The most common techniques to return an estimate MSE are Testing: a testing sequence independent of and distributed according to the same probability distribution is used to assess the quality. In practice unfortunately an additional set of input/output observations is rarely available. Holdout: The holdout method sometimes called test sample estimation partitions the data into two mutually exclusive subsets the training set tr and the holdout or test set where tr ts. -fold Cross-validation: the set is randomly divided into mutually exclusive test partitions of approximately equal size. The cases not found in each test partition are independently used for selecting the hypothesis which will be tested on the partition itself. The average error over all the partitions is the cross-validated error rate. Resampling techniques p.12/33

g 4 f 4 g g f ; hhh; g f f 4 g ; hhh; g i d _N j g The -fold cross-validation This is the algorithm in detail: 1. split the dataset into roughly equal-sized parts. 2. For the th part fit the model to the other parts of the data and calculate the prediction error of the fitted model when predicting the -th part of the data. 3. Do the above for prediction error. and combine the estimates of Let be the part of containing the th sample. Then the cross-validation estimate of the MSE prediction error is i MSE cv $ d _N j & N N 4! NPO where by the model estimated with the & th observation returned th part of the data removed. Resampling techniques p.13/33 i i N denotes the fitted value for othe

n lm l4 f n l4 k -fold cross-validation : at each iteration remaining for the test. of data are used for training and the 10% 90% Resampling techniques p.14/33

n lm l4 f n l4 k -fold cross-validation : at each iteration remaining for the test. of data are used for training and the 10% 90% Resampling techniques p.14/33

n lm l4 f n l4 k -fold cross-validation : at each iteration remaining for the test. of data are used for training and the 10% 90% Resampling techniques p.14/33

n lm l4 f n l4 k -fold cross-validation : at each iteration remaining for the test. of data are used for training and the 90% 10% Resampling techniques p.14/33

n lm l4 f n l4 k -fold cross-validation : at each iteration remaining for the test. of data are used for training and the 90% 10% Resampling techniques p.14/33

n lm l4 f n l4 k -fold cross-validation : at each iteration remaining for the test. of data are used for training and the 90% 10% Resampling techniques p.14/33

! f! 4 i i ; hhh; i Leave-one-out cross validation The cross-validation algorithm where leave-one-out algorithm. is also called the This means that for each th sample 1. we carry out the parametric identification leaving that observation out of the training set 2. we compute the predicted value for the denoted by N & N th observation The corresponding estimate of the MSE prediction error is MSE loo $ N & N N 4! NPO Resampling techniques p.15/33

lr! q! 4 ; hhh; ; > s 4 l l s p i p N p r 4 R TP: An overfitting example Consider a dataset N N o:p i where and }u} z {u{y l l l 4 4 v wuwyx l ; l l ; tut l ; is a 3-dimensional vector. Suppose that is linked to by the input/output relation rp $ p F Q# ~ $ where is the th component of the vector Consider as non-linear model a single-hidden-layer neural network (implemented by the R package nnet) with hidden neurons. The number of neurons is an index of the complexity of the Resampling model. techniques p.16/33.

! lr r r $ ƒ h ; We want the estimate the prediction accuracy on a new i.i.d dataset of samples. ts Let us train the neural network on the whole training set. The empirical prediction MSE error is MSE emp ˆ 4l& 4 $ h N ƒ p ; N 4! NPO where However if we test is obtained by the parametric identification step. ƒ T; on the test set we obtain MSE ts 4! ts ts NPO N p N This neural network is seriously overfitting the dataset. The empirical error is a very bad estimate of the MSE. Resampling techniques p.17/33

f l4 f l4 f Šl l h lr! f l h We perform a -fold cross-validation in order to have a better estimate of MSE. We put. Cross-validation implemented in the cv.r R file. The cross-validated estimate of MSE is MSE cv This figure is a much more reliable estimation of the prediction accuracy. The leave-one-out estimate is MSE loo The cross-validated estimate could be used to select a better number of hidden neurons. Resampling techniques p.18/33

2 Model selection Model selection concerns the final choice of the model structure in the set that has been proposed by model generation and assessed by model validation. In real problems this choice is typically a subjective issue and is often the result of a compromise between different factors like the quantitative measures the personal experience of the designer and the effort required to implement a particular model in practice. Here we will consider only quantitative criteria. A possible approach is the winner-takes-all approach where a set of different architectures featuring different complexity are assessed and among them the best one is selected. Resampling techniques p.19/33

f! f \ \ The cost of cross-validation Cross-validation requires the repetition of the parametric identification procedure for times. In the leave-one-out case. The procedure is highly time consuming for a generic non-linear approximator. Note thet for instance in the case of a neural network each parametric identification requires an expensive non-linear optimization procedure. In other words the cost of leave-one-out for a generic approximator is where is the cost of the identification. \! A very special case is represented by linear models. In this case the cost of a leave-one-out is comparable to. The parametric identification procedure has as a by-product the leave-one-out residuals. Resampling techniques p.20/33

Leave-one-out for linear models TRAINING SET PARAMETRIC IDENTIFICATION ON N SAMPLES PRESS STATISTIC N TIMES PUT THE j-th SAMPLE ASIDE PARAMETRIC IDENTIFICATION ON N-1 SAMPLES TEST ON THE j-th SAMPLE LEAVE-ONE-OUT Resampling techniques p.21/33

! i The PRESS statistic The PRESS (Prediction Sum of Squares) statistic is a simple formula which returns the leave-one-out (l-o-o) as a by-product of the parametric identification of The leave-one-out residual is N & N p N N & N N ŒŽ N The PRESS procedure is made of the following steps 1. we use the whole training set to estimate the linear regression coefficients. This procedure is performed only once on the samples and returns as by product the Hat matrix & 2. we compute the residual vector whose term is N p N N Resampling techniques p.22/33

4 i 3. we use the PRESS statistic to compute as ŒŽ N N ŒŽ N NN where is the NN diagonal term of the matrix 4. The resulting leave-one-out estimate of MSE is. MSE loo $ ŒŽ N 4! NPO Note that this is not an approximation but simply a faster way of computing the leave-one-out residual. ŒŽ Resampling techniques p.23/33

+ $ Cross-validation and other estimates Why use cross-validation is simpler estimates are avaialble? The main reason is that these simple estimates are extrapolation of analogous figures for linear models. There extrapolation is doubtful for nonlinear data. The effective number of parameters is not so easy to be determined. Theoretical criticism (Vapnik) vs. the simplest approach (count). The simple criteria requires the estimate of the variance. " The power of cross-validation comes from the reduced number of assumptions and its applicability to complex situations. Resampling techniques p.24/33

d _ d _ oostrap estimates of prediction error (1) The simplest bootstrap approach generates bootstrap samples estimates the model on each of them and then applies each fitted model to the original sample to give estimates _ d MSE of the prediction error. _ d ƒ T; $ _ d N ƒ p ; N NPO The overall bootstrap estimate of prediction error is the average of these estimates. MSE bs 4 MSE O $ _ d N ƒ p ; N 4! NPO O 4 Resampling techniques p.25/33

d _ d _ oostrap estimates of prediction error (2) This simple bootstrap approach turns out not to work very well. A second way to employ the bootstrap pardigm is to estimate the bias (or optimism) of the empirical risk. Bias MSE emp MSE MSE emp The bootstrap estimate of this quantity is obtained by generating bootstrap samples estimating the model for each of them and calculating the difference between the MSE on and the empirical risk on. _ d _ d _ d ƒ T; Bias MSE emp bs 4 MSE 4 MSE emp O O The final estimate is then MSE bs2 MSE emp Bias MSE emp bs Resampling techniques p.26/33

l4 ~ l h R TP: bootstrap prediction error We apply the bootstrap procedure to the same regression problem assessed before by cross-validation. We apply the simple bootstrap procedure with. We obtain MSE bs. R-file booterr.r Resampling techniques p.27/33

l4 d _ d _ R TP: bootstrap prediction error (2) Here we apply the bootstrap procedure to estimate the optimism of the empirical MSE. We put. These are the experimental results We denote by MSEemp the empirical MSE of the neural network trained on. In other words training and test set are in this case the same. _ d We denote by MSE and tested on _ d _ d the MSE of the neural network trained on. We compute the bootstrap estimate Bias MSE emp bs of the optimism. Resampling techniques p.28/33

The final estimate is then h 4 h œ š œ š r ~ l Šr l h MSE bs2 MSE emp Bias MSE emp bs In our case we have MSE emp MSE 1 9.78e-07 4.00 2 1.71e-06 3.69 3 9.13e-07 3.66 4 7.25e-07 7.03 5 1.31e-06 3.19 6 1.45e-06 1.33 7 1.79e-06 4.62 8 1.10e-06 6.94 9 1.33e-06 2.20 10 1.95e-06 3.94 and then MSE bs ~ ˆ 4l& 0. Resampling techniques p.29/33

n 0 h Other bootstrap estimates Let us consider the simple bootstrap estimator obtained by calculating the prediction error of elements of. MSE bs. This is for each _ d One problem with this estimate is that we have points belonging to the training set and test set. In particular it can n be shown that the percentage of points belonging to both is. _ d In order to remedy to this problem an idea could be to consider as test samples only the ones that do not belong to. _ d Resampling techniques p.30/33

ž ž i Other bootstrap estimates (II) We will define by MSE that do not belong to the MSE computed only on the samples. _ d MSE $ _ d N ƒ p ; N ŸKb 4 N 4! NPO where is the set of indices of the bootstrap samples that do not contain and is the number of such bootstrap samples. _ d \ N N _ d Resampling techniques p.31/33

ž ž ž l l $ ˆ h h The estimator However it can be shown that the samples used to compute MSE are particularly hard test cases (too far from the training set) and that consequently MSE. MSE On the other side the test cases used in (too close to the test set) and consequently optimistic estimate of MSE. is a pessimistic estimate of MSE emp are too easy MSE emp is an A more reliable estimator is provided by the weighted average of the two quantities MSE MSE emp 0 MSE Resampling techniques p.32/33

! 64! 64! 64! Some final consideration Empirical error is a strong biased estimate of the prediction error and has order. It can be shown (Efron 1983) that leave-one-out cross validation reduces the bias of the estimate from to. However it can have high variability particularly for small. The simplest bootstrap optimistic). $ MSE bs has large downward bias (too In general bootstrap methods has smaller variability but tends to have larger bias. Bootstrap methods are more informative if we want more than the simple estimate of the prediction error. Cross-validation behaves more like the bootstrap if the cost function is smooth (like the quadratic case). Resampling techniques p.33/33