classification/ Discriminant analysis functions
显示 更早的评论
- I'm not really a user of MatLab but I have a homework so that I'm learning and I need your help please
- so ...I have a char data in MS excel file , it gives a matrix of 1824x22 + extra column called class with is either ('e','p'), I have to divide the data into 2 haves(testing_set , training_set), **train the corresponding classifier.
- compare the categories produced (classifications) by classify function on the testing set with the actual classes provided in the testing set. Calculate the percentage of cases that that were correctly classified by the four types of classify function.
- I already did this so far and I can't go any farther without help
MATLAB code
[~,raw]=xlsread('orderedfile','A1:V8124')
raw = double(cell2mat(raw))
dimen = size(raw)
nraw = dimen(1)
ncol = dimen(2)
train_set = raw(1:(nrow/2),:)
test_set = raw(((nrow/2) + 1):nrow,:)
回答(2 个)
Tom Lane
2013-4-18
0 个投票
I don't have your data. I suspect you need to define train_set and test_set to have only the data without the class labels. Then create train_class and test_class to hold the class labels. Then type "help classify" and "help confusionmat" and see where that gets you.
2 个评论
Hadeel Arslan
2013-4-18
Tom Lane
2013-4-18
I wasn't really looking for your data, just getting across the idea that depending on how it's organized you probably need to separate the class labels from the rest. Do try out my suggestion and see how it goes.
类别
在 帮助中心 和 File Exchange 中查找有关 Classification Ensembles 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!