pyspark.ml.util.
DefaultParamsWriter
Specialization of MLWriter for Params types
MLWriter
Params
Class for writing Estimators and Transformers whose parameters are JSON-serializable.
New in version 2.3.0.
Methods
extractJsonParams(instance, skipParams)
extractJsonParams
option(key, value)
option
Adds an option to the underlying MLWriter.
overwrite()
overwrite
Overwrites if the output path already exists.
save(path)
save
Save the ML instance to the input path.
saveImpl(path)
saveImpl
save() handles overwriting and then calls this method.
saveMetadata(instance, path, sc[, …])
saveMetadata
Saves metadata + Params to: path + “/metadata”
session(sparkSession)
session
Sets the Spark Session to use for saving/loading.
Attributes
sc
Returns the underlying SparkContext.
sparkSession
Returns the user-specified Spark Session or the default.
Methods Documentation
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.
save() handles overwriting and then calls this method. Subclasses should override this method to implement the actual saving of the instance.
class
timestamp
sparkVersion
uid
paramMap
defaultParamMap (since 2.4.0)
(optionally, extra metadata)
Extra metadata to be saved at same level as uid, paramMap, etc.
If given, this is saved in the “paramMap” field.
Attributes Documentation