Stat841f09 - Wiki Course Notes

# Y a quadratic function with some random variation

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t; - nr(0,,) &gt; y&lt; x205xrom20003 &gt; - ^-.*+nr(0,,.) &gt; xet&lt; rom5,,) &gt; ts - nr(011 &gt; yet&lt; xet205xetrom5,,.) &gt; ts - ts^-.*ts+nr(0003 &gt; p &lt; l(~) &gt; 1 - myx &gt; p &lt; l( ~pl(,) &gt; 2 - my oyx2) &gt; p &lt; l( ~pl(,0) &gt; n - my oyx1) &gt; pi&lt; l(~(i()+(o()) &gt;s - myIsnx)Icsx) xvalues for the training set are based on a distribution, while the test set has a values are determined by distribution. y , a quadratic function with some random variation. Polynomial least square fits of degree 1, 2, and 10 are calculated, as well as a fit of &gt; &gt;#cluaetema surderro dge 1pl &gt; aclt h en qae ro f ere oy &gt; &gt;sm(-rdc(1dt.rm())2/eghy &gt; u(ypeitp,aafaex)^)lnt() &gt; 1564 &gt;1 .702 &gt; &gt;sm(ts-rdc(1dt.rm(=ts))2/eghyet &gt; u(yetpeitp,aafaexxet)^)lnt(ts) &gt; 7771 &gt;1 .265 . P olynomial fits to curved data set. Training and test mean squared errors for the linear fit. These are both quite high - and since the data is non- linear, the different mean value of the test data increases the error quite a bit. &gt; &gt;#cluaetema surderro dge 2pl &gt; aclt h en qae ro f ere oy &gt; &gt;sm(-rdc(2dt.rm())2/eghy &gt; u(ypeitp,aafaex)^)lnt() &gt; 00686 &gt;1 .8047 &gt; &gt;sm(ts-rdc(2dt.rm(=ts))2/eghyet &gt; u(yetpeitp,aafaexxet)^)lnt(ts) &gt; 00473 &gt;1 .8042 This fit is far better - and there is not much difference between the training and test error, either. &gt; &gt;#cluaetema surderro dge 1 pl &gt; aclt h en qae ro f ere 0 oy &gt; &gt;sm(-rdc(ndt.rm())2/eghy &gt; u(ypeitp,aafaex)^)lnt() &gt; 00975 &gt;1 .7658 &gt; &gt;sm(ts-rdc(ndt.rm(=ts))2/eghyet &gt; u(yetpeitp,aafaexxet)^)lnt(ts) &gt; 1673 &gt;1 5.19 With a high- degree polynomial, the training error continues to decrease, but not by much - and the test set error has risen again. The overfitting makes it a poor predictor. As the degree of the polynomial rises further, the accuracy of the computer becomes an issue - and a good fit is not even consistently produced for the training data. &gt; &gt;#cluaemeo sncsft &gt; aclt s f...
View Full Document

## This document was uploaded on 03/07/2014.

Ask a homework question - tutors are online