Extract Params from metadata, and set them in the instance.
Extract Params from metadata, and set them in the instance. This works if all Params (except params included by skipParams
list) implement org.apache.spark.ml.param.Param.jsonDecode().
The params included in skipParams
won't be set. This is useful if some params don't implement org.apache.spark.ml.param.Param.jsonDecode() and need special handling.
Helper for OpPipelineStageWriter which extracts the JSON to save.
Helper for OpPipelineStageWriter which extracts the JSON to save. This is useful for ensemble models which need to save metadata for many sub-models.
Note: this method was taken from DefaultParamsWriter.getMetadataToSave, but modified to avoid requiring Spark session instead use org.apache.spark.SPARK_VERSION
OpPipelineStageWriter for details on what this includes.
Parse metadata JSON string produced by DefaultParamsWriter.getMetadataToSave().
Parse metadata JSON string produced by DefaultParamsWriter.getMetadataToSave(). This is a helper function for loadMetadata().
Note: this method was taken from DefaultParamsWriter.parseMetadata, but modified to avoid failing on loading of Spark models prior to 2.4.x
JSON string of metadata
If non empty, this is checked against the loaded metadata.
IllegalArgumentException
if expectedClassName is specified and does not match metadata
Direct wrappers for ml private DefaultParamsWriter and DefaultParamsReader needed to read/write Spark stages in OP