필터 지우기
필터 지우기

Too many input arguments

조회 수: 1 (최근 30일)
Kia
Kia 2023년 8월 18일
답변: Voss 2023년 8월 18일
Hello,
Can somebody explain to me why when I run the code I get this message.
Error using aresparams
Too many input arguments.
Error in test (line 17)
trainParams = aresparams('maxFuncs', -1, 'c', 3, 'cubic', true, 'cubicFastLevel', 2,'selfInteractions',1, 'maxInteractions', 1, 'threshold',1e-4,'prune',
true, 'fastK',20, 'fastBeta',1, 'fastH',5,'useMinSpan', -1,'useEndSpan',-1, 'maxFinalFuncs',inf, 'endSpanAdjust',1, 'newVarPenalty',0.1,'terminateWhenInfGCV',false, 'allowLinear',0);
  댓글 수: 2
Dyuman Joshi
Dyuman Joshi 2023년 8월 18일
There is no built-in or toolbox function named as aresparams in MATLAB.
Seems like it's a user-defined function.
Please copy and paste the output of this code -
which -all aresparams
Image Analyst
Image Analyst 2023년 8월 18일
It's not a built-in MATLAB function. Check the documentation for it.
help aresparams
--- aresparams not found. Showing help for parseparams instead. --- PARSEPARAMS Finds first string argument. [REG, PROP]=PARSEPARAMS(ARGS) takes cell array ARGS and separates it into two argument sets: REG being all arguments up to, but excluding, the first string argument encountered in ARGS. PROP contains all other arguments after, and including, the first string argument encountered. PARSEPARAMS is intended to isolate possible property value pairs in functions using VARARGIN as the input argument.

댓글을 달려면 로그인하십시오.

답변 (1개)

Voss
Voss 2023년 8월 18일
According to section 2.2 (page 7) of the attached pdf document, aresparams should be called like:
trainParams = aresparams(maxFuncs, c, cubic, cubicFastLevel, ...
selfInteractions, maxInteractions, threshold, prune, fastK, fastBeta, fastH, ...
useMinSpan, useEndSpan, maxFinalFuncs, endSpanAdjust, newVarPenalty, ...
terminateWhenInfGCV, yesInteract, noInteract, allowLinear, forceLinear)
Which means that you don't pass the parameter names ('maxFuncs','c','cubic', etc.), only their values (-1,3,true, etc.).
So instead of this:
trainParams = aresparams('maxFuncs', -1, 'c', 3, 'cubic', true, 'cubicFastLevel', 2, ...
'selfInteractions',1, 'maxInteractions', 1, 'threshold',1e-4,'prune',true, 'fastK',20, ...
'fastBeta',1, 'fastH',5,'useMinSpan', -1,'useEndSpan',-1, 'maxFinalFuncs',inf, ...
'endSpanAdjust',1, 'newVarPenalty',0.1,'terminateWhenInfGCV',false, 'allowLinear',0);
Do this:
trainParams = aresparams(-1, 3, true, 2, 1, 1, 1e-4, true, 20, 1, 5, -1, -1, inf, 1, 0.1, false, 0);

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by