class Node extends Serializable with Logging
Node in a decision tree.
About node indexing: Nodes are indexed from 1. Node 1 is the root; nodes 2, 3 are the left, right children. Node index 0 is not used.
- Annotations
- @Since( "1.0.0" )
- Source
- Node.scala
- Alphabetic
- By Inheritance
- Node
- Logging
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Node(id: Int, predict: Predict, impurity: Double, isLeaf: Boolean, split: Option[Split], leftNode: Option[Node], rightNode: Option[Node], stats: Option[InformationGainStats])
- id
integer node id, from 1
- predict
predicted value at the node
- impurity
current node impurity
- isLeaf
whether the node is a leaf
- split
split to calculate left and right nodes
- leftNode
left child
- rightNode
right child
- stats
information gain stats
- Annotations
- @Since( "1.2.0" )
Value Members
-
val
id: Int
- Annotations
- @Since( "1.0.0" )
-
var
impurity: Double
- Annotations
- @Since( "1.2.0" )
-
var
isLeaf: Boolean
- Annotations
- @Since( "1.0.0" )
-
var
leftNode: Option[Node]
- Annotations
- @Since( "1.0.0" )
-
def
predict(features: Vector): Double
predict value if node is not leaf
predict value if node is not leaf
- features
feature value
- returns
predicted value
- Annotations
- @Since( "1.1.0" )
-
var
predict: Predict
- Annotations
- @Since( "1.0.0" )
-
var
rightNode: Option[Node]
- Annotations
- @Since( "1.0.0" )
-
var
split: Option[Split]
- Annotations
- @Since( "1.0.0" )
-
var
stats: Option[InformationGainStats]
- Annotations
- @Since( "1.0.0" )
-
def
toString(): String
- Definition Classes
- Node → AnyRef → Any