フィルターのクリア

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 ビュー (過去 30 日間)
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 件のコメント
Greg Heath
Greg Heath 2016 年 5 月 8 日
My only suggestion is to search both the NEWSGROUP and ANSWERS using the search word 'crossval'

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by