Classification problem parsed as regression problem when Split Criterion is supplied to fitcensemble

Hi

I ran a hyperparameter optimization to find the best parameters for a two-class classification problem using fitcensemble. But when I try to use these I get a strange warning:

Warning: You must pass ‘SplitCriterion’ as a character vector ‘mse’ for regression.

What is wrong with my code? The warning comes when I use a boosting ensemble as ‘method’. When I remove the ‘SplitCriterion’ everything works fine, but I cannot understand why Matlab somewhere on the line thinks this is a regression problem when I use fit”c”ensemble. Here is a toy example with arbitrarily chosen settings that you can run to reproduce the Warning/Error.

load carsmall
X = table(Acceleration,Cylinders,Displacement,Horsepower,Mfg,Model_Year,Weight,MPG);
X.Cylinders(X.Cylinders < 8) = 0; % Create two classes in the Cylinders variablet = templateTree( 'MaxNumSplits', 30,...
'MinLeafSize', 10,...
'SplitCriterion', 'gdi');
classificationEnsemble = fitcensemble(X,'Cylinders',...
'Method', 'LogitBoost', ...
'NumLearningCycles',12,...
'Learners',t,...
'KFold',7,...
'LearnRate',0.1);

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

This is a bug in the search space for hyperparameter optimization in fitcensemble, which will cause it to evaluate some unnecessary points. During the optimization, whenever ‘Method’ is LogitBoost or GentleBoost, ‘SplitCriterion’ is always internally set to ‘mse’. But the search space is defined in a way that doesn’t acknowledge that, so it unnecessarily passes SplitCrierion values of ‘gdi’ and ‘deviance’ during the optimization.

So all points that you see with LogitBoost/gdi and LogitBoost/deviance are really just LogitBoost/mse.

Oddly, you are not allowed to explicitly specify ‘SplitCriterion’,’mse’ with fitcensemble. Instead, when LogitBoost or GentleBoost are used, you need to omit the SplitCriterion argument entirely.

The optimization results are still valid. You just need to adjust what arguments you pass to fitcensemble at the end. The simple fix in your case is to delete line 8 of your original code sample, which specifies the SplitCriterion. Here’s the result:

SEE COMPLETE ANSWER CLICK THE LINK

--

--

--

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Life with Adobe Launch (1/2): The rocky history of Adobe Tag Managers

Discovering HPE Discover

2022 WeAreDevelopers World Congress (WWC2022) in Berlin

How to integrate paystack payment gateway in Magento 2.

Using Vagrant’s Ansible Provisioner to Build a FreeIPA Server

Launch a Leprechaun And Take Its Gold in 3D (Unity, free)

It’s Objects All The Way Down! (almost)

The Hard Behind The Soft

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Technical Source

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

More from Medium

Is there a way to configure the %d in fprintf function to

Don’t misuse R-squared (r²) value

Quick overview of few optimizers used for Neural Networks

Neural networks at its simplest