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 CenterFile Exchange 中查找有关 Gaussian Process Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by