⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 is_occ.m

📁 模式识别工具箱,希望对大家有用!
💻 M
字号:
%IS_OCC True for one-class classifiers
%
% is_occ(w) returns true if the classifier w is a one-class classifier,
% outputting only classes 'target' and/or 'outlier' and having a
% structure with threshold stored.
%
% Only problem is when you have an empty oc-classifier, this will
% return false. I cannot help it:-(

% 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 Netherlands


function out = is_occ(w)

[d,lablist] = mapping(w);
switch size(lablist,1)
case 1
   out = strcmp(lablist,'target')|...
         strcmp(lablist,'target ')|...
         strcmp(lablist,'outlier');
case 2
   out = strcmp(lablist,['outlier';'target ']) | ...
         strcmp(lablist,['target ';'outlier']);
otherwise
   out = 0;
end

if out
  if isstruct(d)
    fn = fieldnames(d);
    out = out & sum(strcmp(fn,'threshold'));
  end
  if ~out
    warning('IS_OCC: Missing threshold field in OC classifier.');
  end
end

return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -