class_docstr: Base class for :py:class:`Model`s that wrap Java/Scala
  implementations. Subclasses should inherit this class before
  param mix-ins, because this sets the UID from the Java model.
class_docstr_tok: ["Base","class","for",":","py",":","class",":","`","Model","`","s","that","wrap","Java\/Scala","implementations",".","Subclasses","should","inherit","this","class","before","param","mix-ins",",","because","this","sets","the","UID","from","the","Java","model","."]
docstr: Initialize this instance with a Java model object.
  Subclasses should call this constructor, initialize params,
  and then call _transfer_params_from_java.
  
  This instance can be instantiated without specifying java_model,
  it will be assigned after that, but this scenario only used by
  :py:class:`JavaMLReader` to load models.  This is a bit of a
  hack, but it is easiest since a proper fix would require
  MLReader (in pyspark.ml.util) to depend on these wrappers, but
  these wrappers depend on pyspark.ml.util (both directly and via
  other ML classes).
docstr_tok: ["Initialize","this","instance","with","a","Java","model","object",".","Subclasses","should","call","this","constructor",",","initialize","params",",","and","then","call","_transfer_params_from_java",".","This","instance","can","be","instantiated","without","specifying","java_model",",","it","will","be","assigned","after","that",",","but","this","scenario","only","used","by",":","py",":","class",":","`","JavaMLReader","`","to","load","models",".","This","is","a","bit","of","a","hack",",","but","it","is","easiest","since","a","proper","fix","would","require","MLReader","(","in","pyspark.ml.util",")","to","depend","on","these","wrappers",",","but","these","wrappers","depend","on","pyspark.ml.util","(","both","directly","and","via","other","ML","classes",")","."]
code: def __init__(self, java_model: Optional["JavaObject"] = None):
      """
      Initialize this instance with a Java model object.
      Subclasses should call this constructor, initialize params,
      and then call _transfer_params_from_java.
  
      This instance can be instantiated without specifying java_model,
      it will be assigned after that, but this scenario only used by
      :py:class:`JavaMLReader` to load models.  This is a bit of a
      hack, but it is easiest since a proper fix would require
      MLReader (in pyspark.ml.util) to depend on these wrappers, but
      these wrappers depend on pyspark.ml.util (both directly and via
      other ML classes).
      """
      super(JavaModel, self).__init__(java_model)
      if java_model is not None:
          # SPARK-10931: This is a temporary fix to allow models to own params
          # from estimators. Eventually, these params should be in models through
          # using common base classes between estimators and models.
          self._create_params_from_java()
  
          self._resetUid(java_model.uid())
  
imports: from abc import ABCMeta, abstractmethod
  from typing import Any, Generic, Optional, List, Type, TypeVar, TYPE_CHECKING
  from pyspark import since
  from pyspark import SparkContext
  from pyspark.sql import DataFrame
  from pyspark.ml import Estimator, Predictor, PredictionModel, Transformer, Model
  from pyspark.ml.base import _PredictorParams
  from pyspark.ml.param import Param, Params
  from pyspark.ml.util import _jvm
  from pyspark.ml.common import inherit_doc, _java2py, _py2java
label_desc: Use image node_id 1 to create a new JavaModel object from inherited base classes: JavaTransformer, Model with example: obj = JavaModel(java_model)