简体   繁体   中英

Matlab TreeBagger OOBPrediction flag not recognized

I'm using the TreeBagger function of Matlab R2015a with the name-value pairs 'OOBPrediction', 'on' and 'OOBPredictorImportance', 'on' . Now I'm getting the following error message:

Invalid parameter name: OOBPrediction.

In the official Matlab documentation this name-value pair is listed.

What is wrong?

This actually seems to be something that has changed between MATLAB R2015a and R2015b.

If you consult the documentation inside your own MATLAB R2015a (using either help treebagger or doc treebagger ), you will get an example where that parameter is used:

Example:

 load fisheriris b = TreeBagger(50,meas,species,'oobpred','on') plot(oobError(b)) xlabel('number of grown trees') ylabel('out-of-bag classification error') 

In the online documentation and in newer versions of MATLAB, you will find something like:

Example:

 load fisheriris b = TreeBagger(50,meas,species,'OOBPrediction','on') plot(oobError(b)) xlabel('number of grown trees') ylabel('out-of-bag classification error') 

Long story short:

  • Use oobpred instead of OOBPrediction .
  • Consult your local MATLAB documentation for your version of MATLAB, rather than the online one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM