Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
formatting, nits
  • Loading branch information
smurakozi committed Jan 18, 2018
commit b6e06e8e280f97560a342e287072f0b49e85bb79
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import org.apache.spark.ml.param.ParamMap
import org.apache.spark.ml.util.{DefaultReadWriteTest, MLTest, MLTestingUtils}
import org.apache.spark.sql.Dataset

class BisectingKMeansSuite
extends MLTest with DefaultReadWriteTest {
class BisectingKMeansSuite extends MLTest with DefaultReadWriteTest {

import Encoders._
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import testImplicits._ instead


Expand Down Expand Up @@ -106,6 +105,7 @@ class BisectingKMeansSuite
testTransformerByGlobalCheckFunc[Vector](dataset.toDF(), model,
"features", predictionColName) { rows =>
val clusters = rows.map(_.getAs[Int](predictionColName)).toSet
assert(clusters.size === k)
assert(clusters === Set(0, 1, 2, 3, 4))
assert(model.computeCost(dataset) < 0.1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These checks which do not use "rows" should go outside of testTransformerByGlobalCheckFunc

assert(model.hasParent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import org.apache.spark.ml.util.TestingUtils._
import org.apache.spark.sql.{Dataset, Row}


class GaussianMixtureSuite extends MLTest
with DefaultReadWriteTest {
class GaussianMixtureSuite extends MLTest with DefaultReadWriteTest {

import testImplicits._
import Encoders._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import org.apache.spark.ml.linalg.{Vector, Vectors}
import org.apache.spark.ml.util.{DefaultReadWriteTest, MLTest, MLTestingUtils}
import org.apache.spark.ml.util.TestingUtils._
import org.apache.spark.sql._
import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder


object LDASuite {
def generateLDAData(
Expand Down Expand Up @@ -62,8 +60,7 @@ object LDASuite {
class LDASuite extends MLTest with DefaultReadWriteTest {

import testImplicits._

implicit val vectorEncoder = ExpressionEncoder[Vector]()
import Encoders._

val k: Int = 5
val vocabSize: Int = 30
Expand Down