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

LogisticRegressionModel prediction optimization

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.0
    • 3.1.0
    • ML
    • None

    Description

      if needed, method getThreshold and/or following logic to compute rawThreshold is called on each instance.

       

      override def getThreshold: Double = {
        checkThresholdConsistency()
        if (isSet(thresholds)) {
          val ts = $(thresholds)
          require(ts.length == 2, "Logistic Regression getThreshold only applies to" +
            " binary classification, but thresholds has length != 2.  thresholds: " + ts.mkString(","))
          1.0 / (1.0 + ts(0) / ts(1))
        } else {
          $(threshold)
        }
      } 

       

            val rawThreshold = if (t == 0.0) {
                  Double.NegativeInfinity
                } else if (t == 1.0) {
                  Double.PositiveInfinity
                } else {
                  math.log(t / (1.0 - t))
                } 

      Attachments

        Activity

          People

            podongfeng Ruifeng Zheng
            podongfeng Ruifeng Zheng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: