crossval with multiple linear model

4 ビュー (過去 30 日間)
Tania
Tania 2014 年 8 月 10 日
編集済み: Tania 2014 年 8 月 10 日
Hey all,
Currently, I am trying to build a crossvalidated linear model. I have started with the crossval function ... but I dont really understand the function...
I thought this one might be the right one.. vals = crossval(fun,X,Y,...) is used when data are stored in separate variables X, Y, ... . All variables (column vectors, matrices, or arrays) must have the same number of rows. fun is called with the training subsets of X, Y, ... , followed by the test subsets of X, Y, ... , as follows:
testvals = fun(XTRAIN,YTRAIN,...,XTEST,YTEST,...)
Normally I would built my linear model in the following way:
>> load('fisheriris'); Y = species; X = meas; mdl=fitlm(X,Y)
Now using the trying to get the crossvalidated model I started the following testvals=fun(XTRAIN,YTRAIN,...XTEST,YTEST,...); vals=crossval(fun, X,Y,...)
But this doesnt work unfortunately....
Anyone any ideas?
Thank you!!

回答 (0 件)

カテゴリ

Help Center および File ExchangeGaussian Process Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by