Changing 'double' to 'dataset'
이전 댓글 표시
Hello guys, I'm up for a Multivariate Statistics and Pattern Recognition exam on Monday, and I am in trouble. I'm supposed to start off by doing Leave-one-out cross validation on a dataset I have acquired (<http://archive.ics.uci.edu/ml/datasets/seeds> that one), but I can't even seem to get started.
I believe LOOCV builds a test and a trainingset, and so far I have looked at the 'crossval' and 'cvpartition' classes, but I can't figure out what to feed them.
Additionally, as I've been going through our notes for this class, it seems the simplest code wont work on my dataset, because it is a 'double' instead of a 'dataset' - can someone tell me how to change that?
Thank you for your time.
답변 (4개)
Azzi Abdelmalek
2013년 1월 11일
편집: Azzi Abdelmalek
2013년 1월 11일
x=1:20
out=dataset(x)
Peter Perkins
2013년 1월 11일
Mads, "doing Leave-one-out cross validation on a dataset" is way too vague to understand what statistical model or method you're trying to cross-validate, but as far as creating a dataset array from a text file, it's a simple call to the constructor:
ds = dataset('File','seeds_dataset.txt','ReadVarNames',false, ...
'VarNames',{'Area' 'Perimeter' 'Compactness' 'Length' 'Width' 'Asymmetry' 'Groove','Variety'})
Of course, it turns out that the file is tab-delimited but has some double tabs in it, which you'll have to clean up in a text editor.
Actually, I can't tell from your description if your problem is that you want to create a dataset array, or if you already have one and want to create a double matrix from it. If the latter is what you need to do, then it's just
x = double(ds)
Hope this helps.
카테고리
도움말 센터 및 File Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!