?? oc_set.m
字號(hào):
function a = oc_set(a,clnr)% OC_SET makes an one-class dataset%% A = oc_set(A,clnr)%% Change a normal dataset A into an one-class dataset: the class% indicated by the classnr (clnr) is made target class and all other% data becomes outliers class. The labels are changed to 'target' and% 'outlier'.%% It is also possible to use a class label:%% A = oc_set(A,label)%% but then the type of the label should be a char (else you cannot% distinguish it from a class number, can you?:-))% Copyright: D. Tax, R.P.W. Duin, davidt@ph.tn.tudelft.nl% Faculty of Applied Physics, Delft University of Technology% P.O. Box 5046, 2600 GA Delft, The Netherlandsif (nargin<2) clnr = 1;end% match the labellist type with the clnr[nlab,lablist,m,k,c] = dataset(a);if isa(clnr,'char') if isa(lablist,'double') [nlab,clnr] = renumlab(getlab(a),str2num(clnr)); else % lablist is character [nlab,clnr] = renumlab(getlab(a),clnr); endend% make the new labels:lablist = str2mat('target', 'outlier');laba = ones(m,size(lablist,2));I = find(nlab==clnr);laba(I,:) = ones(length(I),1)*lablist(1,:);I = find(nlab~=clnr);laba(I,:) = ones(length(I),1)*lablist(2,:);a = dataset(+a,char(laba));return
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -