Package org.apache.spark.ml.util
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
-
Method Summary
Modifier and TypeMethodDescriptionAdds an option to the underlying MLWriter.Overwrites if the output path already exists.void
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
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
Overwrites if the output path already exists.- Returns:
- (undocumented)
-
save
Saves the ML instances to the input path.- Parameters:
path
- (undocumented)- Throws:
IOException
-
session
Description copied from interface:BaseReadWrite
Sets the Spark Session to use for saving/loading.- Specified by:
session
in interfaceBaseReadWrite
- Parameters:
sparkSession
- (undocumented)- Returns:
- (undocumented)
-