Brace indexing error using fitcensemble

조회 수: 1 (최근 30일)
yoav.bendor1
yoav.bendor1 2024년 7월 16일
댓글: yoav.bendor1 2024년 7월 17일
I am getting strange errors trying to use fitcensemble, so I refered to the manual, and ran the simple following example, which I found on the fitcensemble help page:
load census1994
Mdl1 = fitcensemble(adultdata,'salary')
these two simple lines of code should result in a classification ensemble but instead I get the following error:
Error using classreg.learning.internal.callBuiltinFitEnsemble
Error: File: callBuiltinFitEnsemble.m Line: 191 Column: 41
Brace indexing into the result of a function call is not supported. Assign the result of 'curvature' to a variable first, then brace index into it.
Error in classreg.learning.ensemble.Ensemble/fitBuiltinEnsemble (line 457)
classreg.learning.internal.callBuiltinFitEnsemble(this.Method,...
Error in classreg.learning.classif.ClassificationEnsemble (line 85)
this = fitBuiltinEnsemble(this,nlearn,dataSummary,classSummary);
Error in classreg.learning.FitTemplate/fit (line 292)
[varargout{1:nargout}] = this.MakeFitObject(X,Y,W,this.ModelParams,fitArgs{:});
Error in fitensemble (line 364)
obj = fit(temp,X,Y);
Error in fitcensemble (line 212)
obj = fitensemble(X, Y, Method, NumLearningCycles, Learners, ...
So I feel like the problem is not my code, but instead I wonder if the problem is with some of the recent updates?
I am using version: '24.1.0.2628055 (R2024a) Update 4'
on a 64-bit Windows® platform

채택된 답변

Vinayak
Vinayak 2024년 7월 17일
Hi Yoav,
The error you're encountering with fitcensemble seems to be related to the way MATLAB is handling the internal variable curvature in the callBuiltinFitEnsemble function. This issue might have arisen due to some recent updates or changes in your MATLAB environment.
To resolve this, you can try restoring the default MATLAB path and refreshing the toolbox cache. Running the following commands should help:
>> restoredefaultpath
>> rehash toolboxcache
This should fix the issue. If the problem persists, you might need to contact MathWorks Technical Support.
  댓글 수: 1
yoav.bendor1
yoav.bendor1 2024년 7월 17일
thanks. this indeed resolved the error.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by