Note Cross Validation
Transcript of Note Cross Validation
8/8/2019 Note Cross Validation
http://slidepdf.com/reader/full/note-cross-validation 1/3
N o t e o n f r e e l u n c h e s a n d c r o s s - v a l i d a t i o n
C y r i l G o u t t e
D e p a r t m e n t o f M a t h e m a t i c a l M o d e l l i n g , b u i l d i n g 3 2 1
T e c h n i c a l U n i v e r s i t y o f D e n m a r k , D K - 2 8 0 0 L y n g b y , D e n m a r k
J a n u a r y 2 8 , 1 9 9 7
A b s t r a c t . T h e \ n o f r e e l u n c h " t h e o r e m s ( W o l p e r t a n d M a c r e a d y , 1 9 9 5 ) h a v e s p a r k e d h e a t e d d e b a t e i n t h e
c o m p u t a t i o n a l l e a r n i n g c o m m u n i t y . A r e c e n t c o m m u n i c a t i o n , ( Z h u a n d R o h w e r , 1 9 9 6 ) a t t e m p t s t o d e m o n s t r a t e
t h e i n e c i e n c y o f c r o s s - v a l i d a t i o n o n a s i m p l e p r o b l e m . W e e l a b o r a t e o n t h i s r e s u l t b y c o n s i d e r i n g a b r o a d e r
c l a s s o f c r o s s - v a l i d a t i o n . W e s h o w t h a t w h e n u s e d m o r e s t r i c t l y , c r o s s - v a l i d a t i o n c a n y i e l d t h e e x p e c t e d r e s u l t s o n
s i m p l e e x a m p l e s .
1 I n t r o d u c t i o n
A r e c e n t c o n t r i b u t i o n t o c o m p u t a t i o n a l l e a r n i n g , a n d n e u r a l n e t w o r k s i n p a r t i c u l a r , t h e \ n o f r e e l u n c h "
( N F L ) t h e o r e m s ( W o l p e r t a n d M a c r e a d y , 1 9 9 5 ) g i v e s u r p r i s i n g i n s i g h t i n t o c o m p u t a t i o n a l l e a r n i n g s c h e m e s .
O n e i m p l i c a t i o n o f t h e N F L i s t h a t n o l e a r n i n g a l g o r i t h m p e r f o r m s b e t t e r t h a n r a n d o m g u e s s i n g o v e r a l l
p o s s i b l e l e a r n i n g s i t u a t i o n .
T h i s m e a n s i n p a r t i c u l a r t h a t t h e w i d e l y u s e d c r o s s - v a l i d a t i o n ( C V ) m e t h o d s , i f s u c c e s s f u l i n s o m e c a s e s ,
s h o u l d f a i l o n o t h e r s . C o n s i d e r i n g t h e p o p u l a r i t y o f t h e s e s c h e m e s , i t i s t h e r e f o r e o f c o n s i d e r a b l e i n t e r e s t t o
e x h i b i t s u c h a p r o b l e m w h e r e t h e u s e o f C V l e a d s t o a d e c r e a s e i n p e r f o r m a n c e . ( Z h u a n d R o h w e r , 1 9 9 6 )
p r o p o s e a s i m p l e s e t t i n g i n w h i c h a \ c r o s s - v a l i d a t i o n " m e t h o d y i e l d s w o r s e r e s u l t s t h a n t h e m a x i m u m
l i k e l i h o o d e s t i m a t o r i t i s b a s e d o n . I n t h e f o l l o w i n g , w e e x t e n d t h e s e r e s u l t s t o a s t r i c t e r d e n i t i o n o f
c r o s s - v a l i d a t i o n a n d p r o v i d e a n a n a l y s i s a n d d i s c u s s i o n o f t h e r e s u l t s .
2 E x p e r i m e n t s
T h e e x p e r i m e n t a l s e t t i n g i s t h e f o l l o w i n g : a G a u s s i a n v a r i a b l e x h a s m e a n a n d u n i t v a r i a n c e . T h e m e a n
s h o u l d b e e s t i m a t e d f r o m a s a m p l e o f n r e a l i s a t i o n o f x . T h r e e e s t i m a t o r s a r e c o m p a r e d :
A ( n ) : T h e m e a n o f t h e n p o i n t s a m p l e . I t i s t h e m a x i m u m l i k e l i h o o d a n d l e a s t m e a n s q u a r e s e s t i m a t o r ,
a n d a l s o t h e o p t i m a l u n b i a s e d e s t i m a t o r .
B ( n ) : T h e m a x i m u m o f t h e n p o i n t s a m p l e .
C ( n ) : T h e e s t i m a t o r o b t a i n e d b y a c r o s s - v a l i d a t i o n c h o i c e b e t w e e n A ( n ) a n d B ( n ) .
T h e o r i g i n a l \ c r o s s - v a l i d a t i o n " s e t t i n g o f ( Z h u a n d R o h w e r , 1 9 9 6 ) w i l l b e n o t e d Z ( n + 1 ) : i t s a m p l e s o n e
a d d i t i o n a l p o i n t , a n d c h o o s e s t h e e s t i m a t o r A o r B t h a t i s c l o s e r t o t h i s p o i n t . H o w e v e r , t h e w i d e l y u s e d
c o n c e p t o f c r o s s - v a l i d a t i o n ( R i p l e y , 1 9 9 6 ; F A Q , 1 9 9 6 ) c o r r e s p o n d s t o r e s a m p l i n g a n d a v e r a g i n g e s t i m a t o r s ,
r a t h e r t h a n s a m p l i n g a d d i t i o n a l p o i n t s . I n t h i s c o n t e x t , t h e e s t i m a t o r p r o p o s e d i n ( Z h u a n d R o h w e r , 1 9 9 6 )
i s c l o s e r t o t h e \ s p l i t - s a m p l e " a . k . a . \ h o l d o u t " m e t h o d . T h i s m e t h o d i s k n o w n t o b e n o i s y , e s p e c i a l l y
w h e n t h e v a l i d a t i o n s e t i s s m a l l , w h i c h i s t h e c a s e h e r e .
O n t h e o t h e r h a n d , a t h o r o u g h c r o s s - v a l i d a t i o n s c h e m e w o u l d u s e s e v e r a l v a l i d a t i o n s e t s r e s a m p l e d f r o m
t h e d a t a a n d a v e r a g e o v e r t h e m b e f o r e c h o o s i n g e s t i m a t o r A o r B . I n t h e l e a v e - o n e - o u t ( L O O ) a v o u r , t h e
C V s c o r e i s c a l c u l a t e d a s t h e a v e r a g e d i s t a n c e b e t w e e n e a c h p o i n t a n d t h e e s t i m a t o r o b t a i n e d o n t h e r e s t .
1
8/8/2019 Note Cross Validation
http://slidepdf.com/reader/full/note-cross-validation 2/3
N o t e t h a t i n t h i s s e t t i n g , e s t i m a t o r Z o p e r a t e s w i t h m o r e i n f o r m a t i o n ( o n e s u p p l e m e n t a r y d a t a p o i n t ) t h a n
t h e L O O e s t i m a t o r . T h e r e s u l t o f a n e x p e r i m e n t d o n e w i t h n = 1 6 a n d 1 0
6
s a m p l e s g i v e s m e a n s q u a r e d
e r r o r s :
A ( 1 6 ) : 0 : 0 6 2 4 B ( 1 6 ) : 3 : 4 1 4 1 C
L O O
( 1 6 ) : 0 : 0 6 2 4 Z ( 1 6 + 1 ) : 0 : 5 7 5 5 ( 1 )
I n t h i s c a s e , i t s e e m s t h a t t h e p r o p e r c r o s s - v a l i d a t i o n p r o c e d u r e a l w a y s p i c k s e s t i m a t o r A , w h o s e t h e o r e t i c a l
m e a n s q u a r e d e r r o r i s 1 = 1 6 = 0 : 0 6 2 5 .
3 S h o r t a n a l y s i s
T h e s i m p l e s e t t i n g u s e d i n t h e s e e x p e r i m e n t s a l l o w s f o r a f u l l a n a l y s i s o f t h e b e h a v i o u r o f C
L O O
. C o n s i d e r
n d a t a p o i n t s x
i
. T h e l e a v e - o n e - o u t c r o s s - v a l i d a t i o n e s t i m a t e i s c o m p u t e d b y a v e r a g i n g t h e s q u a r e d e r r o r
b e t w e e n e a c h p o i n t a n d t h e a v e r a g e o f t h e r e s t . L e t u s d e n o t e b y x t h e a v e r a g e o f a l l x
i
a n d b y x
k
t h e
a v e r a g e o f a l l x
i
e x c l u d i n g e x a m p l e x
k
: x
k
=
n x x
k
n 1
. A c c o r d i n g l y , ( x
k
x
k
) =
n
n 1
( x x
k
) , h e n c e t h e
n a l c r o s s - v a l i d a t i o n s c o r e f o r e s t i m a t o r A :
C V =
n
n 1
2
S ( x ) ( 2 )
w h e r e S ( w ) =
1
n
P
n
i = 1
( w x
i
)
2
i s t h e m e a n s q u a r e d e r r o r b e t w e e n e s t i m a t o r w a n d t h e d a t a . L e t u s
n o w n o t e x
= m a x f x
i
g t h e m a x i m u m o f t h e ( a u g m e n t e d ) s a m p l e , a n d x
= m a x ( f x
i
g n x
) t h e s e c o n d
l a r g e s t e l e m e n t . T h e c r o s s - v a l i d a t i o n s c o r e f o r e s t i m a t o r B i s :
C V
= S ( x
) +
1
n
( x
x
)
2
( 3 )
I n o r d e r t o r e a l i s e h o w t h e c r o s s - v a l i d a t i o n e s t i m a t o r b e h a v e s , l e t u s r s t r e c a l l t h a t x i s t h e l e a s t m e a n
s q u a r e s e s t i m a t o r . A s s u c h , i t m i n i m i s e s S ( w ) . F u r t h e r m o r e , f r o m H u y g e n s ' f o r m u l a , S ( x
) = S ( x ) +
( x x
)
2
. A c c o r d i n g l y , w e c a n r e - w r i t e C V
= S ( x ) + ( x x
)
2
+
1
n + 1
( x
x
)
2
.
T h e s e o b s e r v a t i o n s h o w t h a t i n o r d e r f o r ( 3 ) t o b e l o w e r t h a n ( 2 ) r e q u i r e s a n e x t r e m e l y u n l i k e l y s i t u a t i o n .
x
s h o u l d b e q u i t e c l o s e t o b o t h x a n d x
. O n e s u c h s i t u a t i o n c o u l d a r i s e i n t h e p r e s e n c e o f a n e g a t i v e
o u t l i e r . A s t h e m e a n i s n o t r o b u s t , t h e o u t l i e r w o u l d p r o d u c e a s e v e r e d o w n w a r d b i a s i n e s t i m a t o r A .
T h u s t h e m a x i m u m c o u l d v e r y w e l l b e a b e t t e r e s t i m a t o r t h a n t h e m e a n i n s u c h a c a s e . H o w e v e r , n o s u c h
h a p p e n s t a n c e w a s o b s e r v e d i n 5 : 1 0
6
e x p e r i m e n t s .
4 D i s c u s s i o n
1 . I n e x p e r i m e n t ( 1 ) , t h e L O O e s t i m a t o r d o e s n o t u s e t h e a d d i t i o n a l d a t a p o i n t a l l o t e d t o C . W h e n
u s i n g t h i s d a t a p o i n t , t h e p e r f o r m a n c e i s i d e n t i c a l : C V d o e s n o t e x t r a c t a n y i n f o r m a t i o n f r o m t h e
e x t r a s a m p l e , b u t a t l e a s t m a n a g e s t o k e e p t h e i n f o r m a t i o n i n t h e o r i g i n a l s a m p l e .
2 . T h e c r o s s - v a l i d a t i o n e s t i m a t o r d o e s n o t p e r f o r m b e t t e r t h a n A ( 1 6 ) , a n d y i e l d s w o r s e p e r f o r m a n c e
t h a n A ( 1 7 ) , f o r w h i c h t h e t h e o r e t i c a l M S E i s 1 = 1 7 ' 0 : 0 5 8 8 . H o w e v e r , i t s h o u l d b e p o i n t e d o u t t h a t
t h e s e t t i n g i m p o s e s a c h o i c e b e t w e e n A a n d B . T h e o p t i m a l c h o i c e o v e r 1 0
5
s a m p l e s l e a d s t o a m e a n
s q u a r e d e r r o r o f j u s t 0 : 0 6 1 7 . T h i s i s a l o w e r b o u n d f o r e s t i m a t o r C , a n d i s s i g n i c a n t l y b e y o n d t h e
o p t i m a l , 1 7 - p o i n t s e s t i m a t o r . O n t h e o t h e r h a n d , a r a n d o m c h o i c e b e t w e e n A a n d B l e a d s t o a m e a n
s q u a r e d e r r o r o f 1 : 7 3 6 4 o n t h e s a m e s a m p l e .
3 . I t c o u l d b e o b j e c t e d t h a t L O O i s j u s t o n e m o r e a v o u r o f c r o s s - v a l i d a t i o n , s o r e s u l t s f e a t u r i n g t h i s
p a r t i c u l a r e s t i m a t o r d o n o t n e c e s s a r i l y h a v e a n y r e l e v a n c e t o C V m e t h o d s a s a w h o l e . L e t u s t h e n
c o m p a r e t h e p e r f o r m a n c e o f m - f o l d C V o n t h e o r i g i n a l 1 6 p o i n t s a m p l e . I t c o n s i s t s i n d i v i d i n g
t h e s a m p l e i n t o m v a l i d a t i o n s e t s , a n d a v e r a g i n g t h e v a l i d a t i o n p e r f o r m a n c e o f t h e m e s t i m a t o r s
o b t a i n e d o n t h e r e m a i n i n g d a t a . F o r 1 0
5
s a m p l e s , w e g e t ( C V
m
i s t h e m - f o l d C V e s t i m a t o r ) :
E s t i m a t o r A B C V
1 6
= C
L O O
C V
8
C V
4
C V
2
M S E 0 . 0 6 2 4 3 . 4 1 4 1 0 . 0 6 2 4 0 . 0 6 2 4 0 . 0 6 2 4 0 . 0 6 2 8
2
8/8/2019 Note Cross Validation
http://slidepdf.com/reader/full/note-cross-validation 3/3
T h e s l i g h t d e c r e a s e i n p e r f o r m a n c e i n C V
2
i s d u e t o t h e f a c t t h a t w e a v e r a g e o v e r o n l y 2 v a l i d a t i o n
s e t s . I f w e r e s a m p l e t w o a d d i t i o n a l s e t s , t h e p e r f o r m a n c e i s i d e n t i c a l t o a l l o t h e r C V e s t i m a t o r s .
4 . W h i l e r e q u i r i n g a d d i t i o n a l c o m p u t a t i o n , n o n e o f t h e C V e s t i m a t o r s a b o v e g a i n a n y t h i n g o n A ( e v e n
w i t h t h e h e l p o f o n e a d d i t i o n a l p o i n t ) . B e t t e r p e r f o r m a n c e c a n h o w e v e r b e o b s e r v e d w i t h a d i e r e n t
c h o i c e o f e s t i m a t o r s . C o n s i d e r e . g . D ( n ) a m e d i a n o f t h e s a m p l e , a n d E ( n ) t h e a v e r a g e b e t w e e n t h e
m i n a n d t h e m a x . U s i n g 1 0
5
s a m p l e , w e c o m p a r e t h e C V e s t i m a t o r t o D a n d E c a l c u l a t e d o n 1 6
p o i n t s a m p l e s :
D ( 1 6 ) : 0 : 0 9 4 9 E ( 1 6 ) : 0 : 1 5 2 9 C
L O O
( 1 6 ) : 0 : 0 9 3 1 ( 4 )
H e r e c r o s s - v a l i d a t i o n o u t p e r f o r m s b o t h e s t i m a t o r s i t i s b a s e d o n .
5 C o n c l u s i o n
T h e n o f r e e l u n c h r e s u l t s i m p l y t h a t f o r e v e r y s i t u a t i o n w h e r e a l e a r n i n g m e t h o d p e r f o r m s b e t t e r t h a n
r a n d o m g u e s s i n g , a n o t h e r s i t u a t i o n e x i s t s w h e r e i t p e r f o r m s c o r r e s p o n d i n g l y w o r s e . N u m e r o u s r e p o r t s
o f s u c c e s s f u l a p p l i c a t i o n s o f u s u a l l e a r n i n g p r o c e d u r e s s u g g e s t t h a t t h e \ u n s p e c i e d p r i o r " u n d e r w h i c h
t h e y o u t p e r f o r m r a n d o m g u e s s i n g v e r i f y i n a n u m b e r o f p r a c t i c a l c a s e s . E x h i b i t i n g t h e s e a s s u m p t i o n s i s
o f i m p o r t a n c e i n o r d e r t o c h e c k w h e t h e r t h e c o n d i t i o n s f o r s u c c e s s h o l d w h e n t a c k l i n g a n e w p r o b l e m .
H o w e v e r , i t i s u n l i k e l y t h a t s u c h a s i m p l e s e t t i n g c o u l d c h a l l e n g e t h e s e y e t u n k n o w n a s s u m p t i o n s . C r o s s -
v a l i d a t i o n h a s m a n y d r a w b a c k s , a n d i t i s f a r f r o m b e i n g t h e m o s t e c i e n t l e a r n i n g m e t h o d ( e v e n a m o n g
n o n - B a y e s i a n f r a m e w o r k s ) . I n t h a t s i m p l e c a s e , t h o u g h , i t p r o v i d e s p e r f e c t l y d e c e n t r e s u l t s .
W e n o w k n o w t h a t t h e r e i s \ n o f r e e l u n c h " f o r c r o s s - v a l i d a t i o n . H o w e v e r , t h e t a s k o f e x h i b i t i n g a n e a s i l y
u n d e r s t a n d a b l e , n o n - d e g e n e r a t e c a s e w h e r e i t f a i l s h a s y e t t o b e c o m p l e t e d . F u r t h e r m o r e , t h e t a s k o f
e x h i b i t t i n g t h e \ h i d d e n " p r i o r u n d e r w h i c h c r o s s - v a l i d a t i o n i s b e n e c i a l p r o v i d e s c h a l l e n g i n g p r o s p e c t s
f o r t h e f u t u r e .
A c k n o w l e d g m e n t s T h i s w o r k w a s p a r t i a l l y s u p p o r t e d b y a r e s e a r c h f e l l o w s h i p f r o m t h e T e c h n i c a l U n i -
v e r s i t y o f D e n m a r k ( D T U ) . I a m g r a t e f u l t o t h e ( a n o n y m o u s ) r e f e r e e s f o r c o n s t r u c t i v e c r i t i c i s m , a n d t o
H u a i y u Z h u a n d L a r s K a i H a n s e n f o r c h a l l e n g i n g r e m a r k s o n e a r l i e r d r a f t s o f t h e p a p e r .
R e f e r e n c e s
F A Q ( 1 9 9 6 ) . N e u r a l n e t w o r k F r e q u e n t l y A s k e d Q u e s t i o n s . U R L :
f t p : / / f t p . s a s . c o m / p u b / n e u r a l / F A Q 3 . h t m l . F A Q i n c o m p . a i . n e u r a l - n e t s , P a r t 3 .
R i p l e y , B . D . ( 1 9 9 6 ) . P a t t e r n R e c o g n i t i o n a n d N e u r a l N e t w o r k s . C a m b r i d g e U n i v e r s i t y P r e s s .
W o l p e r t , D . H . a n d M a c r e a d y , W . G . ( 1 9 9 5 ) . T h e m a t h e m a t i c s o f s e a r c h . T e c h n i c a l R e p o r t S F I - T R - 9 5 -
0 2 - 0 1 0 , S a n t a F e I n s t i t u t e .
Z h u , H . a n d R o h w e r , R . ( 1 9 9 6 ) . N o f r e e l u n c h f o r c r o s s v a l i d a t i o n . N e u r a l C o m p u t a t i o n , 8 ( 7 ) : 1 4 2 1 { 1 4 2 6 .
3