You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by xi...@apache.org on 2023/03/21 04:56:09 UTC

[spark] branch branch-3.4 updated: [SPARK-42864][ML][3.4] Make `IsotonicRegression.PointsAccumulator` private

This is an automated email from the ASF dual-hosted git repository.

xinrong pushed a commit to branch branch-3.4
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.4 by this push:
     new 5222cfd58a7 [SPARK-42864][ML][3.4] Make `IsotonicRegression.PointsAccumulator` private
5222cfd58a7 is described below

commit 5222cfd58a717fec7a025fdf4dfcde0bb4daf80c
Author: Ruifeng Zheng <ru...@apache.org>
AuthorDate: Tue Mar 21 12:55:44 2023 +0800

    [SPARK-42864][ML][3.4] Make `IsotonicRegression.PointsAccumulator` private
    
    ### What changes were proposed in this pull request?
    Make `IsotonicRegression.PointsAccumulator` private, which was introduced in https://github.com/apache/spark/commit/3d05c7e037eff79de8ef9f6231aca8340bcc65ef
    
    ### Why are the changes needed?
    `PointsAccumulator` is implementation details, should not be exposed
    
    ### Does this PR introduce _any_ user-facing change?
    no
    
    ### How was this patch tested?
    existing UT
    
    Closes #40500 from zhengruifeng/isotonicRegression_private.
    
    Authored-by: Ruifeng Zheng <ru...@apache.org>
    Signed-off-by: Xinrong Meng <xi...@apache.org>
---
 .../org/apache/spark/mllib/regression/IsotonicRegression.scala      | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mllib/src/main/scala/org/apache/spark/mllib/regression/IsotonicRegression.scala b/mllib/src/main/scala/org/apache/spark/mllib/regression/IsotonicRegression.scala
index fbf0dc9c357..12a78ef4ec1 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/regression/IsotonicRegression.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/regression/IsotonicRegression.scala
@@ -331,7 +331,7 @@ class IsotonicRegression private (private var isotonic: Boolean) extends Seriali
     if (cleanInput.length <= 1) {
       cleanInput
     } else {
-      val pointsAccumulator = new IsotonicRegression.PointsAccumulator
+      val pointsAccumulator = new PointsAccumulator
 
       // Go through input points, merging all points with equal feature values into a single point.
       // Equality of features is defined by shouldAccumulate method. The label of the accumulated
@@ -490,15 +490,13 @@ class IsotonicRegression private (private var isotonic: Boolean) extends Seriali
       .sortBy(_._2)
     poolAdjacentViolators(parallelStepResult)
   }
-}
 
-object IsotonicRegression {
   /**
    * Utility class, holds a buffer of all points with unique features so far, and performs
    * weighted sum accumulation of points. Hides these details for better readability of the
    * main algorithm.
    */
-  class PointsAccumulator {
+  private class PointsAccumulator {
     private val output = ArrayBuffer[(Double, Double, Double)]()
     private var (currentLabel: Double, currentFeature: Double, currentWeight: Double) =
       (0d, 0d, 0d)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org