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

LogisticRegressionModel throws TypeError

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.0.3, 2.1.2, 2.2.0
    • Component/s: MLlib, PySpark
    • Labels:
      None

      Description

      LogisticRegressionModel throws a TypeError using python3 and numpy 1.12.1:

      **********************************************************************
      File "/Users/bago/repos/spark/python/pyspark/mllib/classification.py", line 155, in _main_.LogisticRegressionModel
      Failed example:
      mcm = LogisticRegressionWithLBFGS.train(data, iterations=10, numClasses=3)
      Exception raised:
      Traceback (most recent call last):
      File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/doctest.py", line 1330, in __run
      compileflags, 1), test.globs)
      File "<doctest _main_.LogisticRegressionModel[23]>", line 1, in <module>
      mcm = LogisticRegressionWithLBFGS.train(data, iterations=10, numClasses=3)
      File "/Users/bago/repos/spark/python/pyspark/mllib/classification.py", line 398, in train
      return _regression_train_wrapper(train, LogisticRegressionModel, data, initialWeights)
      File "/Users/bago/repos/spark/python/pyspark/mllib/regression.py", line 216, in _regression_train_wrapper
      return modelClass(weights, intercept, numFeatures, numClasses)
      File "/Users/bago/repos/spark/python/pyspark/mllib/classification.py", line 176, in _init_
      self._dataWithBiasSize)
      TypeError: 'float' object cannot be interpreted as an integer

        Attachments

          Activity

            People

            • Assignee:
              bago.amirbekian Bago Amirbekian
              Reporter:
              bago.amirbekian Bago Amirbekian
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: