RandomTree
public class RandomTreeUndocumented
- 
                  
                  training data set whole as inputed by user in init DeclarationSwift public var originalDataSet: RandomDataSet
- 
                  
                  root node of the decision tree DeclarationSwift public var root: Node?
- 
                  
                  max depth tree is grown DeclarationSwift public var maxDepth: Int
- 
                  
                  number of vars to be used at every step DeclarationSwift public var randomVars: Int
- 
                  
                  column number of target var DeclarationSwift public var target: Int
- 
                  
                  tolerance for regression DeclarationSwift public var tolerance: Float
- 
                  
                  Creates original DataSet to be stored and grows decision tree DeclarationSwift public init (data: [[String]], target: Int, maxDepth: Int = 9999, perform: String, using: String, with: Int, tolerance: Float = 0.1)Parametersdatadata with labels targetcolumn number of label performregression or classification usinginfoGain or giniIndex withnum of random vars to consider at each iteration Return ValueDecisionTree 
- 
                  
                  Returns a set of randomIndices DeclarationSwift public func getRandomIndices(from: RandomDataSet) -> [Int]Parametersfromthe dataset from which the random index need to be selected Return ValueArray of random indexes 
- 
                  
                  displays the grown tree by calling print tree DeclarationSwift public func displayTree()Return ValueNone 
- 
                  
                  prints part of tree at given node and indents wrt. depth DeclarationSwift public func printTree(node: Node, depth: Int)Parametersnodenode to be printed depthdepth of the node wrt. root Return ValueNone 
- 
                  
                  Forms decision regression tree using gini index recursively DeclarationSwift public func giniR(dataset: RandomDataSet, depth: Int) -> NodeParametersdatasetdata left to be used depthcurrent depth Return ValueNode that splits data best 
- 
                  
                  Forms decision classification tree using gini index recursively DeclarationSwift public func giniC(dataset: RandomDataSet, depth: Int) -> NodeParametersdatasetdata left to be used depthcurrent depth Return ValueNode that splits data best 
- 
                  
                  Examine the dataset to create classification Tree with id3 recursively DeclarationSwift public func id3C(dataset: RandomDataSet, depth: Int) -> NodeParametersdatasetdata left to be used depthcurrent depth Return ValueNode that splits data best 
- 
                  
                  / Examine the dataset to create regression tree with id3 recursively DeclarationSwift public func id3R(dataset: RandomDataSet, depth: Int) -> NodeParametersdatasetdata left to be used depthcurrent depth Return ValueNode that splits data best 
- 
                  
                  Classfies/Predicts an example by traversing DeclarationSwift public func classify(example: [[String]]) -> StringReturn Valueclassification/predictions as a string 
 RandomTree Class Reference
      RandomTree Class Reference