multi2dicho.m

来自「this a SVM toolbox,it is very useful for」· M 代码 · 共 33 行

M
33
字号
function [Idicho]=multi2dicho(Imulti,class1)% MULTI2DICHO decomposes multi-class problem to dichotomi.%   [Idicho]=multi2dicho(Imulti,class1)%
% MULTI2DICHO decompose multi-class classification problem
%   into dichotomi problem - class1 against the others.
%   
% Input:
%  Imulti [1xM] class labels \in { 1,2,...K } of multi-class problem.
%  class1 [1x1] labels which will form the first class of the %     dichotomi problem.
%
% Output:
%  Idicho [1xM] class labels \in {1,2}.
%

% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac
% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz
% Written Vojtech Franc (diploma thesis) 23.12.1999, 5.4.2000
% Modifications
% 10-april-2001, V. Franc, created

indexes=[];for i = 1:length(class1),  indexes=[indexes,find(Imulti==class1(i))]; endIdicho=2*ones(1,length(Imulti));Idicho(indexes)=1;return;

⌨️ 快捷键说明

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