Node
public class Node
Undocumented
-
feature name or value (if leaf) stored in the node
Declaration
Swift
public var classification: String -
whether node is a leaf or not
Declaration
Swift
public var isLeaf: Bool -
parent node of the node
Declaration
Swift
public weak var parent: Node? -
used for splitting continous vars
Declaration
Swift
public var cutoff: Float? -
array of branches ot children
Declaration
Swift
public var branches: [Branch] -
creates a node
Declaration
Swift
public init(classification: String, isLeaf: Bool)Parameters
classificationfeature name or value (if leaf) stored in the node
isLeafwhether node is a leaf or not
Return Value
Node
-
Adds a child by linking two nodes with a branch
Declaration
Swift
public func addChild(label: String, node: Node)Parameters
labelfeature value
nodethe child node
Return Value
None
-
Adds a fork by linking two nodes with a branch - used for continous vars
Declaration
Swift
public func addFork(label: String, node: Node, cutoff: Float)Parameters
labelfeature value
nodethe child node
cutoffmore or less than cutoff values
Return Value
None
Node Class Reference