classification/ Discriminant analysis functions
2 ビュー (過去 30 日間)
古いコメントを表示
- 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,:)
0 件のコメント
回答 (2 件)
Tom Lane
2013 年 4 月 18 日
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 件のコメント
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.
参考
カテゴリ
Help Center および File Exchange で Classification についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!