正在加载图片...
est the classifier o =0.6 How badly should the letters be fuzzed tests:=10000 How many times should you test the classifier test=1. tests Answe and←rmif(1,0,4)1 Make the four letters equally likely to appear "A"if0≤rand≤1 within the test batch B"ifl<rand≤2 "D"if3<rand≤4 Create a batch of letters corresponding to the desired correct answers and appropriatel fuzzed up. This will be the batch of data to test our classifier Lest= [(2-floorfrunif(1, 0, 2)1)-1 lin]+morm(25,0, a) if Answer rest ="A" (2-floorfrunif( 1, 0, 2)1)-)-Blin]+ morm(25,0, o) if Answerest="B" (2-floorfrunif( 1,0, 2)-)-Clin]+morm(25, 0, o) if Answertest ""CN RIGHT: =Class(L At sigma=0.6, the Mahalanobis classifier is right about 94% of the time! you do as well in classifying the letters? Also note how fast the Mahalanobis classifier operatesTest the Classifier s := 0.6 How badly should the letters be fuzzed up. tests := 10000 How many times should you test the classifier test := 1.. tests Answertest := rand ‹ runif(1, 0, 4) 1 Make the four letters equally likely to appear "A" if 0 £ rand £ 1 within the test batch. "B" if 1 < rand £ 2 "C" if 2 < rand £ 3 "D" if 3 < rand £ 4 Create a batch of letters corresponding to the desired correct answers and appropriately fuzzed up. This will be the batch of data to test our classifier. �������������fi Ltest := Ø º(2�floor(runif(1, 0, 2) 1) - 1)�Alinø ß + rnorm(25, 0,s) if Answertest = "A" �������������fi Ø(2�floor(runif(1, 0, 2) 1) - 1)�Blinø ß + rnorm(25, 0,s) if Answertest = "B" º �������������fi Ø(2�floor(runif(1, 0, 2) 1) - 1)�Clinø ß + rnorm(25, 0,s) if Answertest = "C" º �������������fi Ø(2�floor(runif(1, 0, 2) 1) - 1)�Dlinø ß + rnorm(25, 0,s) if Answertest = "D" º RIGHTtest := (Class(Ltest) = Answertest) mean(RIGHT) = 0.905 At sigma=0.6, the Mahalanobis classifier is right about 94% of the time! Can you do as well in classifying the letters? Also note how fast the Mahalanobis classifier operates. 7
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有