Brace indexing error using fitcensemble

1 visualización (últimos 30 días)
yoav.bendor1
yoav.bendor1 el 16 de Jul. de 2024
Comentada: yoav.bendor1 el 17 de Jul. de 2024
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

Respuesta aceptada

Vinayak
Vinayak el 17 de Jul. de 2024
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.

Más respuestas (0)

Productos


Versión

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by