Unformatted text preview: represent a 3 are red. See t t e
and l g n
for information on adding the title and legend. Before using c a s f (http://www.mathworks.com/access/helpdesk/help/toolbox/stats/index.html?/access/helpdesk/help/toolbox/stats/classify.html) we can set up a
vector that contains the actual labels for our data, to train the classification algorithm. If we don't know the labels for the data, then the element in the g o pvector
should be an empty string or N N (See grouping data
(http://www.mathworks.com/access/helpdesk/help/toolbox/stats/index.html?/access/helpdesk/help/toolbox/stats/bqziops.html) for more information.)
> gop2140 =2
; We can now classify our data.
> [ls,err PSEIR lg,cef =casf(ape sml,gop 'ier)
ro, OTRO, op
ru, lna'; The full details of this line can be examined in the Matlab help file linked above. What we care about are c a s which contains the labels that the algorithm thinks that
each data point belongs to, and c e f which contains information about the line that algorithm created to separate the data into each class.
We can see the efficacy of the algorithm by comparing c a sto g o p
6 This compares the value in c a sto the value in g o p The answer of 369 tells us that the algorithm correctly determined the class of the point 369 times, out of a
possible 400 data points. This gives us an empirical error rat e of 0.0775.
We can see the line produced by LDA using c e f
> f=srnf' =%+gx%*' k l1,l2)
g%*+gy, , ()
> epo(,[i(ape:1) mxsml(,),mnsml(,),mxsml(,)];
a(ape:2)) wikicour senote.com/w/index.php?title= Stat841&pr intable= yes 12/74 10/09/2013...
View Full Document
This document was uploaded on 03/07/2014.
- Winter '13