Undefined function 'round' for input arguments of type 'categorical' error
2 views (last 30 days)
Show older comments
abdulkawi alareefi
on 26 May 2019
Commented: abdulkawi alareefi
on 27 May 2019
Hello experts,
I was trying to perform the example of function fitclinear described in the matlab help documentation, and I got an error.
Here is the described the example:
load nlpdata
X = X';
Ystats = Y == 'stats';
rng default
Mdl = fitclinear(X,Ystats,'ObservationsIn','columns','Solver','sparsa',...
'OptimizeHyperparameters','auto','HyperparameterOptimizationOptions',...
struct('AcquisitionFunctionName','expected-improvement-plus'))
Here the error that I got:
Undefined function 'round' for input arguments of type 'categorical'.
Error in iscategorical (line 26)
if size(mat, 1) == 1 && all(round(mat) == mat)
Error in classreg.learning.paramoptim.prepareArgValue (line 12)
elseif iscategorical(elt)
Error in classreg.learning.paramoptim.BayesoptInfo.argsFromTable (line 151)
classreg.learning.paramoptim.prepareArgValue(XTable{1,v})}];
Error in classreg.learning.paramoptim.BayesoptInfo/updateArgsFromTable (line 56)
ArgsFromTable = classreg.learning.paramoptim.BayesoptInfo.argsFromTable(XTable);
Error in classreg.learning.paramoptim.createObjFcn/theObjFcn (line 17)
NewFitFunctionArgs = updateArgsFromTable(BOInfo, FitFunctionArgs, XTable);
Error in BayesianOptimization/callObjNormally (line 2184)
Objective = this.ObjectiveFcn(conditionalizeX(this, X));
Error in BayesianOptimization/callObjFcn (line 2145)
= callObjNormally(this, X);
Error in BayesianOptimization/performFcnEval (line 2128)
ObjectiveFcnObjectiveEvaluationTime, this] = callObjFcn(this, this.XNext);
Error in BayesianOptimization/run (line 1836)
this = performFcnEval(this);
Error in BayesianOptimization (line 450)
this = run(this);
Error in bayesopt (line 287)
Results = BayesianOptimization(Options);
Error in classreg.learning.paramoptim.fitoptimizing>doBayesianOptimization (line 182)
OptimizationResults = bayesopt(objFcn, VariableDescriptions, ...
Error in classreg.learning.paramoptim.fitoptimizing (line 136)
[OptimizationResults, XBest] = doBayesianOptimization(objFcn, BOInfo, VariableDescriptions,
HyperparameterOptimizationOptions);
Error in fitclinear (line 218)
[varargout{1:nargout}] = classreg.learning.paramoptim.fitoptimizing('fitclinear',X,y,varargin{:});
Any suggestions will be helpful.
Thanks
5 Comments
Accepted Answer
Walter Roberson
on 27 May 2019
Your Advances in Brain Imaging software is interfering. Use pathtool to move that course to the bottom.
More Answers (0)
See Also
Categories
Find more on Data Type Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!