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

Multinomial Logistic Regression failed when initialWeights is not null

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.1, 1.4.0
    • Component/s: MLlib
    • Labels:
      None

      Description

      This bug is easy to reproduce, when use Multinomial Logistic Regression to train multiclass classification model with non-null initialWeights, it will throw an exception.
      When you run

      val lr = new LogisticRegressionWithLBFGS().setNumClasses(3)
      val model = lr.run(input, initialWeights)
      

      It will throw

      requirement failed: LogisticRegressionModel.load with numClasses = 3 and numFeatures = -1 expected weights of length -2 (without intercept) or 0 (with intercept), but was given weights of length 10
      java.lang.IllegalArgumentException: requirement failed: LogisticRegressionModel.load with numClasses = 3 and numFeatures = -1 expected weights of length -2 (without intercept) or 0 (with intercept), but was given weights of length 10
      

        Attachments

          Activity

            People

            • Assignee:
              yanboliang Yanbo Liang
              Reporter:
              yanboliang Yanbo Liang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: