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

Optimize LogisticRegressionModel.predictPoint

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.4.0
    • Component/s: MLlib
    • Labels:
      None
    • Target Version/s:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: