You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2022/06/22 13:20:54 UTC

[spark] branch master updated: [SPARK-39533][ML] Deprecate scoreLabelsWeight in BinaryClassificationMetrics

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

srowen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 80c28785c3e [SPARK-39533][ML] Deprecate scoreLabelsWeight in BinaryClassificationMetrics
80c28785c3e is described below

commit 80c28785c3e08e541963b58427e22c1ea1de97e8
Author: Ruifeng Zheng <ru...@apache.org>
AuthorDate: Wed Jun 22 08:20:43 2022 -0500

    [SPARK-39533][ML] Deprecate scoreLabelsWeight in BinaryClassificationMetrics
    
    ### What changes were proposed in this pull request?
    Deprecate `scoreLabelsWeight` in `BinaryClassificationMetrics`
    
    ### Why are the changes needed?
    
    `scoreLabelsWeight` in `BinaryClassificationMetrics` is a public variable, but it should be private since it is only for internal purpose.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    existing UT
    
    Closes #36926 from zhengruifeng/ml_make_binclsmetrics_rdd_private.
    
    Authored-by: Ruifeng Zheng <ru...@apache.org>
    Signed-off-by: Sean Owen <sr...@gmail.com>
---
 .../apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mllib/src/main/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala b/mllib/src/main/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala
index 5e40de9a266..a74800f7b18 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala
@@ -45,6 +45,9 @@ class BinaryClassificationMetrics @Since("3.0.0") (
     @Since("1.3.0") val scoreAndLabels: RDD[_ <: Product],
     @Since("1.3.0") val numBins: Int = 1000)
   extends Logging {
+
+  @deprecated("The variable `scoreLabelsWeight` should be private and " +
+    "will be removed in 4.0.0.", "3.4.0")
   val scoreLabelsWeight: RDD[(Double, (Double, Double))] = scoreAndLabels.map {
     case (prediction: Double, label: Double, weight: Double) =>
       require(weight >= 0.0, s"instance weight, $weight has to be >= 0.0")


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