📄 dd_ex2.m
字号:
% DD_EX2%% Show the performance of a whole list of classifiers% Generate data:nrx = 50;X = gendatb([nrx nrx]);% Give names to the features:X = set(X,'featlab',['height';'width ']);% Use now class 2 as target class:X = oc_set(X,'2');% Split the data in training and test data:trnr = 15;[x,z] = gendat(X,[trnr trnr]);% Only use target data for training,x = target_class(x);% and both classes for testing:z = [z;gendatout(x,100)];% Here we goclf;% Train several classifiers and plot the ROC curve:w = parzen_dd(x,0.2);plotroc(dd_roc(z*w),'b');w = svdd(x,0.2,5);plotroc(dd_roc(z*w),'r');w = lpdd(x,0.2,5,'d',2);plotroc(dd_roc(z*w),'g');w = nndd(x,0.2);plotroc(dd_roc(z*w),'y');w = kmeans_dd(x,0.2);plotroc(dd_roc(z*w),'m');w = knndd(x,0.2,5);plotroc(dd_roc(z*w),'k');legend('parzen','svdd','lpdd','nndd','kmeans','knndd')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -