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

Optimize LogisticRegressionModel.predictPoint

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.0
    • 1.4.0
    • MLlib
    • None

    Description

      LogisticRegressionModel.predictPoint could be optimized some. There are several checks which could be moved outside loops or even outside predictPoint to initialization of the model.

      Some include:

      require(numFeatures == weightMatrix.size)
      val dataWithBiasSize = weightMatrix.size / (numClasses - 1)
      val weightsArray = weightMatrix match { ...
      if (dataMatrix.size + 1 == dataWithBiasSize) {...
      

      Also, for multiclass, the 2 loops (over numClasses and margins) could be combined into 1 loop.

      Attachments

        Activity

          People

            yanboliang Yanbo Liang
            josephkb Joseph K. Bradley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: