How to label the training projections obtained by PCA to use for training SVM for classification? MATLAB

前端 未结 3 740
清歌不尽
清歌不尽 2020-12-20 03:11

I have a \"training set\" of images. I have formed the \'Eigenspace\'. Now i need to label the projections to train the SVM. The projections of \"face 1\" to the Eigenspace

3条回答
  •  隐瞒了意图╮
    2020-12-20 04:01

    label = ones(N,1);% N samples in total, +1 represents face 1
    for i=1:N 
        % For each face image, you run
        [signals,V] = pca2(data); % ith data
        if ....  % other faces than face 1
            label(i) = -1;
        end
        face(i,:) = reshape(signals,1,[]);
    end
    model = svmtrain(label,face);
    

提交回复
热议问题