Skip to content

Commit

Permalink
Use unlist directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
yanboliang committed Aug 17, 2016
1 parent aee1382 commit da464f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/pkg/inst/tests/testthat/test_mllib.R
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ test_that("spark.gaussianMixture", {
rSigma <- c(0.08427399, 0.00548772, 0.00548772, 0.09090715,
0.1641373, -0.1673806, -0.1673806, 0.7508951)
expect_equal(stats$lambda, rLambda)
expect_equal(as.vector(unlist(stats$mu)), rMu, tolerance = 1e-3)
expect_equal(as.vector(unlist(stats$sigma)), rSigma, tolerance = 1e-3)
expect_equal(unlist(stats$mu), rMu, tolerance = 1e-3)
expect_equal(unlist(stats$sigma), rSigma, tolerance = 1e-3)
p <- collect(select(predict(model, df), "prediction"))
expect_equal(p$prediction, c(0, 0, 0, 0, 1, 1, 1, 1, 1, 1))

Expand All @@ -565,8 +565,8 @@ test_that("spark.gaussianMixture", {
model2 <- read.ml(modelPath)
stats2 <- summary(model2)
expect_equal(stats$lambda, stats2$lambda)
expect_equal(as.vector(unlist(stats$mu)), as.vector(unlist(stats2$mu)))
expect_equal(as.vector(unlist(stats$sigma)), as.vector(unlist(stats2$sigma)))
expect_equal(unlist(stats$mu), unlist(stats2$mu))
expect_equal(unlist(stats$sigma), unlist(stats2$sigma))

unlink(modelPath)
})
Expand Down

0 comments on commit da464f9

Please sign in to comment.