crossval with multiple linear model
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!