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: [email protected]
For additional commands, e-mail: [email protected]