Package org.apache.spark.ml.tree
Class EnsembleModelReadWrite
Object
org.apache.spark.ml.tree.EnsembleModelReadWrite
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic scala.Tuple3<org.apache.spark.ml.util.DefaultParamsReader.Metadata,
scala.Tuple2<org.apache.spark.ml.util.DefaultParamsReader.Metadata, Node>[], double[]> loadImpl
(String path, SparkSession sparkSession, String className, String treeClassName) Helper method for loading a tree ensemble from disk.static <M extends Params>
voidsaveImpl
(M instance, String path, SparkSession sparkSession, org.json4s.JsonAST.JObject extraMetadata) Helper method for saving a tree ensemble to disk.
-
Constructor Details
-
EnsembleModelReadWrite
public EnsembleModelReadWrite()
-
-
Method Details
-
saveImpl
public static <M extends Params> void saveImpl(M instance, String path, SparkSession sparkSession, org.json4s.JsonAST.JObject extraMetadata) Helper method for saving a tree ensemble to disk.- Parameters:
instance
- Tree ensemble modelpath
- Path to which to save the ensemble model.extraMetadata
- Metadata such as numFeatures, numClasses, numTrees.sparkSession
- (undocumented)
-
loadImpl
public static scala.Tuple3<org.apache.spark.ml.util.DefaultParamsReader.Metadata,scala.Tuple2<org.apache.spark.ml.util.DefaultParamsReader.Metadata, loadImplNode>[], double[]> (String path, SparkSession sparkSession, String className, String treeClassName) Helper method for loading a tree ensemble from disk. This reconstructs all trees, returning the root nodes.- Parameters:
path
- Path given tosaveImpl
className
- Class name for ensemble model typetreeClassName
- Class name for tree model type in the ensemblesparkSession
- (undocumented)- Returns:
- (ensemble metadata, array over trees of (tree metadata, root node)), where the root node is linked with all descendents
- See Also:
-
saveImpl
for how the model was saved
-