• 大小: 373KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-03
  • 语言: 其他
  • 标签: FSVM  识别  

资源简介

用模糊支持向量机(FSVM)实现对手写的0~9的识别,对于模式识别中的分类器学习有很好的参考价值

资源截图

代码片段和文件信息

function   []=classifier(a1kerBeginNumclassnumtotalperclasssampperclassdimension)
% classifier:
%       Classify images by using FSVM with Decision tree.
%
% Usage:
%       []=classifier(a1kerBeginNumclassnumtotalperclasssampperclassdimension)

% Parameters:
%       a1             - matrix of test samplesize=(classnum*totalperclassdimension)
%       ker            - input kernel
%       classnum       - number of classes
%       totalperclass  - number subclass of each class
%       sampperclass   - number of sample of each class
%       dimension      - the dimension of source images
%
%  Author: michael.song(song_xn@yahoo.com.cn)

test_x=a1;
test_y=zeros(classnum*totalperclass1);
for i=BeginNum:BeginNum+classnum-1          % make class flagfrom 1 to classnum
    for j=1:totalperclass
        test_y(((i-BeginNum)*totalperclass+j)1)=i;
    end
end

m1=zeros(classnum1);
pridict_y=zeros(classnum*totalperclass1);

for i=1:classnum*totalperclass
    n=1;
    for p=BeginNum:BeginNum+classnum-1      % initiate matrix m1the value of m1 is from 1 to classnum
        m1((p-BeginNum+1)1)=p;
    end   
    m2=zeros(classnum1);                   % initiate matrix m2
    while(~( ((m1(11)~=0) & (m1(21)==0)) | ((m2(11)~=0) & (m2(21)==0)) ))
        if( mod(n2)~=0)                    % odd layerfrom matrix m1 to m2
           m2=zeros(classnum1);            % m1 is source datam2 is computed data
           pointer2=1;
           for j=1:3:classnum
               class=zeros(31);
               if (((j+2)<=classnum) & (m1(j1)~=0) & (m1(j+11)~=0) & (m1(j+21)~=0))          
                   % a group of training datawhich contains 3 data
                   class(11)=m1(j1);
                   class(21)=m1(j+11);
                   class(31)=m1(j+21);
                   sub_class=3;
                   m2(pointer21)=competition_fsvm(test_x(i:)classkersub_classa1BeginNumsampperclasstotalperclassdimension);
                   pointer2=pointer2+1;
               elseif (((j+2)<=classnum) & (m1(j1)~=0) & (m1(j+11)~=0) & (m1(j+21)==0)) | ( ((j+1)==classnum) & (m1(j1)~=0) & (m1(j+11)~=0))       
                   % a group of training datawhich contains 2 data
                   class(11)=m1(j1);
                   class(21)=m1(j+11);
                   sub_class=2;
                   m2(pointer21)=competition_fsvm(test_x(i:)classkersub_classa1BeginNumsampperclasstotalperclassdimension);
                   pointer2=pointer2+1;
               elseif (((j+2)<=classnum) & (m1(j1)~=0) & (m1(j+11)==0) & (m1(j+21)==0)) | (((j+1)==classnum) & (m1(j1)~=0) & (m1(j+11)==0)) | ((j==classnum) & (m1(j1)~=0)) 
                   % the group only contains single data
                       m2(pointer21)=m1(j1);
                       pointer2=pointer2+1;
               else
                   break;
               end                 
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       5539  2003-12-15 21:54  手写\classifier.m

     文件        229  2012-08-19 19:35  手写\classs.m

     文件       1601  2003-12-04 14:54  手写\competition_fsvm.m

     文件       2254  2003-12-04 15:11  手写\fsvm_kernel.m

     文件       1651  2012-08-19 18:58  手写\getdata.asv

     文件        984  2012-08-19 19:13  手写\getdata.m

     文件       2195  2003-12-04 15:30  手写\IMGPROJ.M

     文件        697  2007-09-14 09:31  手写\imgread.m

     文件       2548  2004-06-09 19:41  手写\KERNEL.M

     文件        294  2004-06-04 09:34  手写\mat2vec.m

     文件     122984  2007-09-16 12:56  手写\shuju.mat

     文件        514  2003-12-04 15:12  手写\take_data.m

     文件        907  2012-08-19 18:49  手写\truepca.m

     文件      58678  2005-05-05 09:25  手写\手写数字\0\0-10.bmp

     文件      58678  2005-05-05 09:23  手写\手写数字\0\s0-1.bmp

     文件      58678  2005-05-05 09:25  手写\手写数字\0\s0-2.bmp

     文件      58678  2005-05-05 09:26  手写\手写数字\0\s0-3.bmp

     文件      58678  2005-05-05 09:26  手写\手写数字\0\s0-4.bmp

     文件      58678  2005-05-05 09:26  手写\手写数字\0\s0-5.bmp

     文件      58678  2005-05-05 09:26  手写\手写数字\0\s0-6.bmp

     文件      58678  2005-05-05 09:26  手写\手写数字\0\s0-7.bmp

     文件      58678  2005-05-05 09:26  手写\手写数字\0\s0-8.bmp

     文件      58678  2005-05-05 09:26  手写\手写数字\0\s0-9.bmp

    ..A.SH.     57344  2012-08-19 19:04  手写\手写数字\0\Thumbs.db

     文件      58678  2005-05-05 09:55  手写\手写数字\1\1-10.bmp

     文件      58678  2005-05-05 09:55  手写\手写数字\1\s1-1.bmp

     文件      58678  2005-05-05 09:55  手写\手写数字\1\s1-2.bmp

     文件      58678  2005-05-05 09:55  手写\手写数字\1\s1-3.bmp

     文件      58678  2005-05-05 09:55  手写\手写数字\1\s1-4.bmp

     文件      58678  2005-05-05 09:55  手写\手写数字\1\s1-5.bmp

............此处省略108个文件信息

评论

共有 条评论