フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can we classify text file using libsvm?

1 回表示 (過去 30 日間)
Logan Harvey
Logan Harvey 2014 年 7 月 7 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I am using this code but it is unable to classify the excel file what steps should be taken to classify this file
clc; clf; clear all; close all;
%% Load the full text
[a, b, c] = xlsread('fulltext.xlsx');
load FeatureSelectionGroup
numFeatures = 423;
%% Define FeatureSelectionGroup
FeatureSelectionGroup = cell(numFeatures,1);
FeatureSelectionGroup(1:223) = cellstr('Course');
FeatureSelectionGroup(224:423) = cellstr('NonCourse');
%% Select features
data = [b(:,2), b(:,4)];
groups = ismember(FeatureSelectionGroup,'Course');
[train, test] = crossvalind('holdOut',groups);
cp = classperf(groups);
svmStruct = svmtrain(data(train,:),groups(train),'showplot',true,'boxconstraint',1e6);
title(sprintf('Kernel Function: %s',func2str(svmStruct.KernelFunction)),'interpreter','none');
%classes = svmclassify(svmStruct,data(test,:));%,'showplot',true);
classperf(cp,classes,test)
Thanks for your answers

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by