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

LogisticRegressionModel throws TypeError

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.1.1
    • 2.0.3, 2.1.2, 2.2.0
    • MLlib, PySpark
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment