您现在的位置:首页 >> 技术文章 >> MATLAB技术 >> 内容

MATLAB代做-python代做-基于matlab的CSVM支持向量机算法仿真

时间:2018-12-26 14:31:42 点击:

  核心提示:MATLAB代做-python代做-基于matlab的CSVM支持向量机算法仿真 ...
function [y,dfce] = svmclass(X,model)
% SVMCLASS Support Vector Machines Classifier.
%
% Synopsis:
%  [y,dfce] = svmclass( X, model )
%
% Description:
%  [y,dfce] = svmclass( X, model ) classifies input vectors X
%    into classes using the multi-class SVM classifier
%      y(i) = argmax f_j(X(:,i))
%            j=1..nfun
%    where f_j are linear functions in the feature space given 
%    by the prescribed kernel function (options.ker, options.arg). 
%    The discriminant functions f_j are determined by 
%      .Alpha [nsv x nfun] ... multipliers associated to SV
%      .b [nclass] ... biases of discriminant functions.
%      .sv.X [dim x nsv] ... support vectors.
%    See 'help kernelproj' for more info about valuation of the 
%    discriminant functions f_j.
%
%    In the binary case nfun=1 the binary SVM classifier is used
%      y(i) = 1 if f(X(:,i) >= 0
%           = 2 if f(X(:,i) < 0
%    where f is the disrimiant function given by Alpha [nsv x 1],
%    b [1x1] and support vectors sv.X.
%      
% Input:
%  X [dim x num_data] Input vectors to be classified.
%
%  model [struct] SVM classifier:
%   .Alpha [nsv x nfun] Multipliers associated to suport vectors.
%   .b [nfun x 1] Biases.
%   .sv.X [dim x nsv] Support vectors.
%   .options.ker [string] Kernel identifier.
%   .options.arg [1 x nargs] Kernel argument(s).
%
% Output:
%  y [1 x num_data] Predicted labels.
%  dfce [nfun x num_data] Values of discriminant functions.
%
% Example:
%  trn = load('riply_trn');
%  model = smo(trn,struct('ker','rbf','arg',1,'C',10));
%  tst = load('riply_tst');
%  ypred = svmclass( tst.X, model );
%  cerror( ypred, tst.y )
% See also 
%  SMO, SVMLIGHT, SVMQUADPROG, KFD, KFDQP, MVSVMCLASS.  
%

% About: Statistical Pattern Recognition Toolbox
% (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac
% <a href="http://www.cvut.cz">Czech Technical University Prague</a>
% <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a>
% <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a>

% Modifications:
% 14-may-2004, VF
% 09-May-2003, VF
% 14-Jan-2003, VF

% allows model to be given in cell
model=c2s(model);

dfce = kernelproj(X, model);
nfun = size(dfce,1);

if nfun == 1,
  % Binary case
  %-------------------------------

  y = ones(size(dfce));
  y( find( dfce < 0 )) = 2;

else  
  % Multi-class case
  %-------------------------------

  [dummy,y] = max( dfce );
end

return;
% EOF

联系:highspeedlogic

QQ :1224848052

微信:HuangL1121

邮箱:1224848052@qq.com

网站:http://www.mat7lab.com/

网站:http://www.hslogic.com/

微信扫一扫:

作者:CSVM支持向量机 来源:CSVM支持向量机
  • 您是如何找到本站的?
  • 百度搜索
  • Google搜索
  • 查阅资料过程中
  • 论坛发现
  • 百度贴吧发现
  • 朋友介绍
本站最新成功开发工程项目案例
相关文章
  • 没有相关文章
相关评论
发表我的评论
  • 大名:
  • 内容:
  • matlab代做|matlab专业代做|python代做|matlab淘宝代做|matlab代写(www.hslogic.com) © 2019 版权所有 All Rights Reserved.
  • Email:highspeed_logic@163.com 站长QQ: 1224848052

    专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科毕业设计、课题设计、论文,毕业论文,Coursework、Eassy、Assignment