Class MLWriter

Object
org.apache.spark.ml.util.MLWriter
All Implemented Interfaces:
org.apache.spark.internal.Logging, BaseReadWrite
Direct Known Subclasses:
ChiSqSelectorModel.ChiSqSelectorModelWriter, CrossValidatorModel.CrossValidatorModelWriter, GeneralMLWriter, TrainValidationSplitModel.TrainValidationSplitModelWriter

public abstract class MLWriter extends Object implements BaseReadWrite, org.apache.spark.internal.Logging
Abstract class for utility classes that can save ML instances in Spark's internal format.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging

    org.apache.spark.internal.Logging.SparkShellLoggingFilter
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    option(String key, String value)
    Adds an option to the underlying MLWriter.
    Overwrites if the output path already exists.
    void
    save(String path)
    Saves the ML instances to the input path.
    session(SparkSession sparkSession)
    Sets the Spark Session to use for saving/loading.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.spark.ml.util.BaseReadWrite

    sc, sparkSession, sqlContext

    Methods inherited from interface org.apache.spark.internal.Logging

    initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq
  • Constructor Details

    • MLWriter

      public MLWriter()
  • Method Details

    • option

      public MLWriter option(String key, String value)
      Adds an option to the underlying MLWriter. See the documentation for the specific model's writer for possible options. The option name (key) is case-insensitive.
      Parameters:
      key - (undocumented)
      value - (undocumented)
      Returns:
      (undocumented)
    • overwrite

      public MLWriter overwrite()
      Overwrites if the output path already exists.
      Returns:
      (undocumented)
    • save

      public void save(String path) throws IOException
      Saves the ML instances to the input path.
      Parameters:
      path - (undocumented)
      Throws:
      IOException
    • session

      public MLWriter session(SparkSession sparkSession)
      Description copied from interface: BaseReadWrite
      Sets the Spark Session to use for saving/loading.
      Specified by:
      session in interface BaseReadWrite
      Parameters:
      sparkSession - (undocumented)
      Returns:
      (undocumented)