spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From WeichenXu123 <...@git.apache.org>
Subject [GitHub] spark pull request #20686: [SPARK-22915][MLlib] Streaming tests for spark.ml...
Date Fri, 02 Mar 2018 04:29:18 GMT
Github user WeichenXu123 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20686#discussion_r171757214
  
    --- Diff: mllib/src/test/scala/org/apache/spark/ml/feature/NormalizerSuite.scala ---
    @@ -17,94 +17,72 @@
     
     package org.apache.spark.ml.feature
     
    -import org.apache.spark.SparkFunSuite
     import org.apache.spark.ml.linalg.{DenseVector, SparseVector, Vector, Vectors}
    -import org.apache.spark.ml.util.DefaultReadWriteTest
    +import org.apache.spark.ml.util.{DefaultReadWriteTest, MLTest}
     import org.apache.spark.ml.util.TestingUtils._
    -import org.apache.spark.mllib.util.MLlibTestSparkContext
     import org.apache.spark.sql.{DataFrame, Row}
     
     
    -class NormalizerSuite extends SparkFunSuite with MLlibTestSparkContext with DefaultReadWriteTest
{
    +class NormalizerSuite extends MLTest with DefaultReadWriteTest {
     
       import testImplicits._
     
    -  @transient var data: Array[Vector] = _
    -  @transient var dataFrame: DataFrame = _
    -  @transient var normalizer: Normalizer = _
    -  @transient var l1Normalized: Array[Vector] = _
    -  @transient var l2Normalized: Array[Vector] = _
    +  @transient val data: Seq[Vector] = Seq(
    +    Vectors.sparse(3, Seq((0, -2.0), (1, 2.3))),
    +    Vectors.dense(0.0, 0.0, 0.0),
    +    Vectors.dense(0.6, -1.1, -3.0),
    +    Vectors.sparse(3, Seq((1, 0.91), (2, 3.2))),
    +    Vectors.sparse(3, Seq((0, 5.7), (1, 0.72), (2, 2.7))),
    +    Vectors.sparse(3, Seq()))
    --- End diff --
    
    I only doubt that when the testsuite object being serialized and then deserialized, the
`data` will lost. But I am not sure which case serialization will occur.


---

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


Mime
View raw message