Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/unrecognized table variable name minLS in Bayesian optimization of TreeBagger

unrecognized table variable name minLS in Bayesian optimization of TreeBagger

PuTI / 2025-03-08
unrecognized table variable name minLS in Bayesian optimization of TreeBagger
Matlab News

Hello,
I tried to do the hyperparameter tuning using bayesian optimization for the randomforest model I made using Treebagger. This is the code I used. I didnot use ensemble bagged trees in regression learner directly because eachtime i check the optimization the minimum mse output is like 498 learners and 1 minimum leaf size for 9 number of predictors.

264 inputTable=readtable(‘dataall_trainingregression.csv’);
265 predictorNames = {‘temp_diff’, ‘temp_median’, ‘NDVI’, ‘Clay’, ‘elevation’, ‘slope’, ‘TWI’, ‘sand’, ‘DOY’};
266 predictors = inputTable(:, predictorNames);
267 response = inputTable.daily_meanSM;
268 n=length(inputTable.daily_meanSM);
269 cvp = cvpartition(n,’KFold’,5);

271 maxMinLS = 20;
272 minLS = optimizableVariable(‘minLS’,[1,maxMinLS],’Type’,’integer’);
273 numPTS = optimizableVariable(‘numPTS’,[1,size(predictors,2)],’Type’,’integer’);
274 hyperparametersRF = [minLS; numPTS];
275 fun = @(params)crossval(‘mse’,predictors,response,’Predfun’,@myfunction,’Partition’,cvp);

277 results = bayesopt(fun,hyperparametersRF,…
‘AcquisitionFunctionName’,’expected-improvement-plus’,’Verbose’,0);

280 function yfit = myfunction(params,predictors,response,test)
281 Mdl1 = TreeBagger(30,predictors,response,…
282 ‘Method’,"regression",’Surrogate’,"on",…
283 ‘PredictorSelection’,"curvature",…
284 ‘OOBPredictorImportance’,"on",’MinLeafSize’,params.minLS,…
285 ‘NumPredictorsToSample’,params.numPTS);
286 yfit = predict(Mdl1,test);

288 end

for this code i receive an error message of :
Error using crossval>evalFun
The function ‘myfunction’ generated the following error:
Unrecognized table variable name ‘minLS’.
Error in crossval>getLossVal (line 529)
funResult = evalFun(funorStr,arg(1:end-1));
Error in crossval (line 428)
[funResult,outarg] = getLossVal(i, nData, cvp, data, predfun);
Error in model_hyperparameter_tuning>@(params)crossval(‘mse’,predictors,response,’Predfun’,@myfunction,’Partition’,cvp) (line 275)
fun = @(params)crossval(‘mse’,predictors,response,’Predfun’,@myfunction,’Partition’,cvp);
Error in BayesianOptimization/callObjNormally (line 13)
Objective = this.ObjectiveFcn(conditionalizeX(this, X));
Error in BayesianOptimization/callObjFcn (line 25)
= callObjNormally(this, X);
Error in BayesianOptimization/runSerial (line 24)
ObjectiveFcnObjectiveEvaluationTime, ObjectiveNargout] = callObjFcn(this, this.XNext);
Error in BayesianOptimization/run (line 9)
this = runSerial(this);
Error in BayesianOptimization (line 184)
this = run(this);
Error in bayesopt (line 323)
Results = BayesianOptimization(Options);

Error in model_hyperparameter_tuning (line 277)
results = bayesopt(fun,hyperparametersRF,…
can anyone please help me to solve this problem. ThanksHello,
I tried to do the hyperparameter tuning using bayesian optimization for the randomforest model I made using Treebagger. This is the code I used. I didnot use ensemble bagged trees in regression learner directly because eachtime i check the optimization the minimum mse output is like 498 learners and 1 minimum leaf size for 9 number of predictors.

264 inputTable=readtable(‘dataall_trainingregression.csv’);
265 predictorNames = {‘temp_diff’, ‘temp_median’, ‘NDVI’, ‘Clay’, ‘elevation’, ‘slope’, ‘TWI’, ‘sand’, ‘DOY’};
266 predictors = inputTable(:, predictorNames);
267 response = inputTable.daily_meanSM;
268 n=length(inputTable.daily_meanSM);
269 cvp = cvpartition(n,’KFold’,5);

271 maxMinLS = 20;
272 minLS = optimizableVariable(‘minLS’,[1,maxMinLS],’Type’,’integer’);
273 numPTS = optimizableVariable(‘numPTS’,[1,size(predictors,2)],’Type’,’integer’);
274 hyperparametersRF = [minLS; numPTS];
275 fun = @(params)crossval(‘mse’,predictors,response,’Predfun’,@myfunction,’Partition’,cvp);

277 results = bayesopt(fun,hyperparametersRF,…
‘AcquisitionFunctionName’,’expected-improvement-plus’,’Verbose’,0);

280 function yfit = myfunction(params,predictors,response,test)
281 Mdl1 = TreeBagger(30,predictors,response,…
282 ‘Method’,"regression",’Surrogate’,"on",…
283 ‘PredictorSelection’,"curvature",…
284 ‘OOBPredictorImportance’,"on",’MinLeafSize’,params.minLS,…
285 ‘NumPredictorsToSample’,params.numPTS);
286 yfit = predict(Mdl1,test);

288 end

for this code i receive an error message of :
Error using crossval>evalFun
The function ‘myfunction’ generated the following error:
Unrecognized table variable name ‘minLS’.
Error in crossval>getLossVal (line 529)
funResult = evalFun(funorStr,arg(1:end-1));
Error in crossval (line 428)
[funResult,outarg] = getLossVal(i, nData, cvp, data, predfun);
Error in model_hyperparameter_tuning>@(params)crossval(‘mse’,predictors,response,’Predfun’,@myfunction,’Partition’,cvp) (line 275)
fun = @(params)crossval(‘mse’,predictors,response,’Predfun’,@myfunction,’Partition’,cvp);
Error in BayesianOptimization/callObjNormally (line 13)
Objective = this.ObjectiveFcn(conditionalizeX(this, X));
Error in BayesianOptimization/callObjFcn (line 25)
= callObjNormally(this, X);
Error in BayesianOptimization/runSerial (line 24)
ObjectiveFcnObjectiveEvaluationTime, ObjectiveNargout] = callObjFcn(this, this.XNext);
Error in BayesianOptimization/run (line 9)
this = runSerial(this);
Error in BayesianOptimization (line 184)
this = run(this);
Error in bayesopt (line 323)
Results = BayesianOptimization(Options);

Error in model_hyperparameter_tuning (line 277)
results = bayesopt(fun,hyperparametersRF,…
can anyone please help me to solve this problem. Thanks Hello,
I tried to do the hyperparameter tuning using bayesian optimization for the randomforest model I made using Treebagger. This is the code I used. I didnot use ensemble bagged trees in regression learner directly because eachtime i check the optimization the minimum mse output is like 498 learners and 1 minimum leaf size for 9 number of predictors.

264 inputTable=readtable(‘dataall_trainingregression.csv’);
265 predictorNames = {‘temp_diff’, ‘temp_median’, ‘NDVI’, ‘Clay’, ‘elevation’, ‘slope’, ‘TWI’, ‘sand’, ‘DOY’};
266 predictors = inputTable(:, predictorNames);
267 response = inputTable.daily_meanSM;
268 n=length(inputTable.daily_meanSM);
269 cvp = cvpartition(n,’KFold’,5);

271 maxMinLS = 20;
272 minLS = optimizableVariable(‘minLS’,[1,maxMinLS],’Type’,’integer’);
273 numPTS = optimizableVariable(‘numPTS’,[1,size(predictors,2)],’Type’,’integer’);
274 hyperparametersRF = [minLS; numPTS];
275 fun = @(params)crossval(‘mse’,predictors,response,’Predfun’,@myfunction,’Partition’,cvp);

277 results = bayesopt(fun,hyperparametersRF,…
‘AcquisitionFunctionName’,’expected-improvement-plus’,’Verbose’,0);

280 function yfit = myfunction(params,predictors,response,test)
281 Mdl1 = TreeBagger(30,predictors,response,…
282 ‘Method’,"regression",’Surrogate’,"on",…
283 ‘PredictorSelection’,"curvature",…
284 ‘OOBPredictorImportance’,"on",’MinLeafSize’,params.minLS,…
285 ‘NumPredictorsToSample’,params.numPTS);
286 yfit = predict(Mdl1,test);

288 end

for this code i receive an error message of :
Error using crossval>evalFun
The function ‘myfunction’ generated the following error:
Unrecognized table variable name ‘minLS’.
Error in crossval>getLossVal (line 529)
funResult = evalFun(funorStr,arg(1:end-1));
Error in crossval (line 428)
[funResult,outarg] = getLossVal(i, nData, cvp, data, predfun);
Error in model_hyperparameter_tuning>@(params)crossval(‘mse’,predictors,response,’Predfun’,@myfunction,’Partition’,cvp) (line 275)
fun = @(params)crossval(‘mse’,predictors,response,’Predfun’,@myfunction,’Partition’,cvp);
Error in BayesianOptimization/callObjNormally (line 13)
Objective = this.ObjectiveFcn(conditionalizeX(this, X));
Error in BayesianOptimization/callObjFcn (line 25)
= callObjNormally(this, X);
Error in BayesianOptimization/runSerial (line 24)
ObjectiveFcnObjectiveEvaluationTime, ObjectiveNargout] = callObjFcn(this, this.XNext);
Error in BayesianOptimization/run (line 9)
this = runSerial(this);
Error in BayesianOptimization (line 184)
this = run(this);
Error in bayesopt (line 323)
Results = BayesianOptimization(Options);

Error in model_hyperparameter_tuning (line 277)
results = bayesopt(fun,hyperparametersRF,…
can anyone please help me to solve this problem. Thanks treebagger, bayesian optimization MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

2019b download installer
2025-05-16

2019b download installer

I want to build a double pendulum system in Simulink but am getting errors relating to the tolerance and step size
2025-05-16

I want to build a double pendulum system in Simulink but am getting errors relating to the tolerance and step size

How to model a simple brake in Simscape (mechanical rotational domain)?
2025-05-16

How to model a simple brake in Simscape (mechanical rotational domain)?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss