Package org.apache.spark.ml.tree
Class DecisionTreeModelReadWrite
Object
org.apache.spark.ml.tree.DecisionTreeModelReadWrite
Helper classes for tree model persistence
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Node
buildTreeFromNodes
(DecisionTreeModelReadWrite.NodeData[] data, String impurityType) Given all data for all nodes in a tree, rebuild the tree.static Node
loadTreeNodes
(String path, org.apache.spark.ml.util.DefaultParamsReader.Metadata metadata, SparkSession sparkSession) Load a decision tree from a file.
-
Constructor Details
-
DecisionTreeModelReadWrite
public DecisionTreeModelReadWrite()
-
-
Method Details
-
loadTreeNodes
public static Node loadTreeNodes(String path, org.apache.spark.ml.util.DefaultParamsReader.Metadata metadata, SparkSession sparkSession) Load a decision tree from a file.- Parameters:
path
- (undocumented)metadata
- (undocumented)sparkSession
- (undocumented)- Returns:
- Root node of reconstructed tree
-
buildTreeFromNodes
public static Node buildTreeFromNodes(DecisionTreeModelReadWrite.NodeData[] data, String impurityType) Given all data for all nodes in a tree, rebuild the tree.- Parameters:
data
- Unsorted node dataimpurityType
- Impurity type for this tree- Returns:
- Root node of reconstructed tree
-