Skip to Main Content Skip to Search
Product Documentation

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 — Set to 'always' to compute in parallel in a reproducible fashion. Default is 'never'. To compute reproducibly, set Streams to a type allowing substreams: 'mlfg6331_64' or 'mrg32k3a'.

  • Streams — A RandStream object or cell array of such objects. If you do not specify Streams, growTrees uses the default stream or streams. If you choose to specify Streams, use a single object except in the case

    • You have an open MATLAB pool

    • UseParallel is 'always'

    • UseSubstreams is 'never'

    In that case, use a cell array the same size as the MATLAB pool.

For more information on using parallel computing, see Parallel Statistics.

See Also

classregtree

  


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