DTrees
The class represents a single decision tree or a collection of decision trees.
The current public interface of the class allows user to train only a single decision tree, however the class is capable of storing multiple decision trees and using them for prediction (by summing responses or using a voting schemes), and the derived from DTrees classes (such as RTrees and Boost) use this capability to implement decision tree ensembles.
See
REF: ml_intro_treesMember of Ml
-
See
-setPriors:
-
Creates the empty model
The static method creates empty decision tree with the specified parameters. It should be then trained using train method (see StatModel::train). Alternatively, you can load the model from file using Algorithm::load\<DTrees\>(filename).
Declaration
Objective-C
+ (nonnull DTrees *)create;
Swift
class func create() -> DTrees
-
Loads and creates a serialized DTrees from a file
Use DTree::save to serialize and store an DTree to disk. Load the DTree from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier
Declaration
Objective-C
+ (nonnull DTrees *)load:(nonnull NSString *)filepath nodeName:(nonnull NSString *)nodeName;
Swift
class func load(filepath: String, nodeName: String) -> DTrees
Parameters
filepath
path to serialized DTree
nodeName
name of node containing the classifier
-
Loads and creates a serialized DTrees from a file
Use DTree::save to serialize and store an DTree to disk. Load the DTree from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier
Declaration
Objective-C
+ (nonnull DTrees *)load:(nonnull NSString *)filepath;
Swift
class func load(filepath: String) -> DTrees
Parameters
filepath
path to serialized DTree
-
Declaration
Objective-C
- (BOOL)getTruncatePrunedTree;
Swift
func getTruncatePrunedTree() -> Bool
-
See
-setUse1SERule:
Declaration
Objective-C
- (BOOL)getUse1SERule;
Swift
func getUse1SERule() -> Bool
-
Declaration
Objective-C
- (BOOL)getUseSurrogates;
Swift
func getUseSurrogates() -> Bool
-
Declaration
Objective-C
- (float)getRegressionAccuracy;
Swift
func getRegressionAccuracy() -> Float
-
See
-setCVFolds:
Declaration
Objective-C
- (int)getCVFolds;
Swift
func getCVFolds() -> Int32
-
Declaration
Objective-C
- (int)getMaxCategories;
Swift
func getMaxCategories() -> Int32
-
See
-setMaxDepth:
Declaration
Objective-C
- (int)getMaxDepth;
Swift
func getMaxDepth() -> Int32
-
Declaration
Objective-C
- (int)getMinSampleCount;
Swift
func getMinSampleCount() -> Int32
-
getCVFolds - see:
-getCVFolds:
Declaration
Objective-C
- (void)setCVFolds:(int)val;
Swift
func setCVFolds(val: Int32)
-
getMaxCategories - see:
-getMaxCategories:
Declaration
Objective-C
- (void)setMaxCategories:(int)val;
Swift
func setMaxCategories(val: Int32)
-
getMaxDepth - see:
-getMaxDepth:
Declaration
Objective-C
- (void)setMaxDepth:(int)val;
Swift
func setMaxDepth(val: Int32)
-
getMinSampleCount - see:
-getMinSampleCount:
Declaration
Objective-C
- (void)setMinSampleCount:(int)val;
Swift
func setMinSampleCount(val: Int32)
-
getRegressionAccuracy - see:
-getRegressionAccuracy:
Declaration
Objective-C
- (void)setRegressionAccuracy:(float)val;
Swift
func setRegressionAccuracy(val: Float)
-
getTruncatePrunedTree - see:
-getTruncatePrunedTree:
Declaration
Objective-C
- (void)setTruncatePrunedTree:(BOOL)val;
Swift
func setTruncatePrunedTree(val: Bool)
-
getUse1SERule - see:
-getUse1SERule:
Declaration
Objective-C
- (void)setUse1SERule:(BOOL)val;
Swift
func setUse1SERule(val: Bool)
-
getUseSurrogates - see:
-getUseSurrogates:
Declaration
Objective-C
- (void)setUseSurrogates:(BOOL)val;
Swift
func setUseSurrogates(val: Bool)