i am trying to use cross validation in order to determine the optimum number of hidden units for neural network. Am getting an error which i am not able to decipher.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Error using crossval>evalFun (line 480) The function '@(Xtrain,Ytrain,Xtest)model_finder(i,Xtrain,Ytrain,Xtest)' generated the following error: Invalid types for comparison.
Error in crossval>getLossVal (line 517) funResult = evalFun(funorStr,arg(1:end-1));
Error in crossval (line 416) [funResult,outarg] = getLossVal(i, nData, cvp, data, predfun);
Error in nnrealmain (line 7) mcr=crossval('mcr',x,y,'predfun',hid_find,'partition',c);
This is the main code i typed for cross validation.
load('permanentpcadata.mat');
mcrs=[]; y=[ones(18,1);2*ones(13,1);3*ones(18,1);4*ones(16,1);5*ones(21,1);6*ones(9,1)];
for i=6:20
hid_find=@(Xtrain,Ytrain,Xtest)model_finder(hiiden_units,Xtrain,Ytrain,Xtest); c=cvpartition(y,'k',10); mcr=crossval('mcr',x,y,'predfun',hid_find,'partition',c);
mcrs=[mcrs mcr]; end
save('crossvalop.mat','mcrs');
index=6:20; plot(index,mcrs);
could you suggest where i have gone wrong in the implementation of cross validation?
1 comentario
Greg Heath
el 8 de Mayo de 2016
My only suggestion is to search both the NEWSGROUP and ANSWERS using the search word 'crossval'
Respuestas (0)
Ver también
Categorías
Más información sobre Gaussian Process Regression en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!