Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-38239

AttributeError: 'LogisticRegressionModel' object has no attribute '_call_java'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.0, 3.0.0, 3.1.0, 3.2.0, 3.3.0
    • 3.3.0
    • MLlib, PySpark
    • None

    Description

      Trying to invoke __repr__ on pyspark.mllib.classification.LogisticRegressionModel leads to AttributeError:

      >>> type(model)
      <class 'pyspark.mllib.classification.LogisticRegressionModel'>
      >>> model
      Traceback (most recent call last):
        File /path/to/python3.9/site-packages/IPython/core/formatters.py:698 in __call__
          return repr(obj)
        File /path/to/spark/python/pyspark/mllib/classification.py:281 in __repr__
          return self._call_java("toString")
      AttributeError: 'LogisticRegressionModel' object has no attribute '_call_java'
      

      This problem was introduced SPARK-14712, where the method was added, with the same implementation, for both ml and mllib.

      Attachments

        Activity

          People

            zero323 Maciej Szymkiewicz
            zero323 Maciej Szymkiewicz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: