Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

growTrees - Class: TreeBagger

Train additional trees and add to ensemble

Syntax

B = growTrees(B,ntrees)
B = growTrees(B,ntrees,'param1',val1,'param2',val2,...)

Description

B = growTrees(B,ntrees) grows ntrees new trees and appends them to those trees already stored in the ensemble B.

B = growTrees(B,ntrees,'param1',val1,'param2',val2,...) pecifies optional parameter name/value pairs:

'nprint'Specifies that a diagnostic message showing training progress should display after every value training cycles (grown trees). Default is no diagnostic messages.
'options'A struct that specifies options that govern computation when growing the ensemble of decision trees. One option requests that the computation of decision trees on multiple bootstrap replicates uses multiple processors, if the Parallel Computing Toolbox is available. Two options specify the random number streams to use in selecting bootstrap replicates. You can create this argument with a call to statset. You can retrieve values of the individual fields with a call to statget. Applicable statset parameters are:
  • 'UseParallel' — If 'always' and if a matlabpool of the Parallel Computing Toolbox is open, compute decision trees drawn on separate boostrap replicates in parallel. If the Parallel Computing Toolbox is not installed, or a matlabpool is not open, computation occurs in serial mode. Default is 'never', or serial computation.

  • 'UseSubstreams' — If 'always' select each bootstrap replicate using a separate Substream of the random number generator (aka Stream). This option is available only with RandStream types that support Substreams. Default is 'never', do not use a different Substream to compute each bootstrap replicate.

  • 'Streams' — An object of the RandStream class, or a cell array of RandStream objects. Default is an empty cell array. If you do not supply a value for this parameter, TreeBagger uses the default RandStream on each MATLAB executable in selecting bootstrap replicates. Otherwise, TreeBagger selects bootstrap replicates using the supplied RandStream object(s). If you select 'UseSubstreams', the Streams parameter, if present, must be a scalar RandStream object. If you do not select 'UseSubstreams', then the Streams parameter, if present, must match the number of processors used for the computation. For serial computation, the Streams parameter must be a scalar. If computation is distributed ('UseParallel' is 'always' and a matlabpool is open), then the Streams parameter must be a cell array of the same length as the matlabpool size. In this case, each element of the cell array supplies the random number generator for bootstrap sampling on one of the parallel workers.

See Also

classregtree

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS