Skip to content

Commit bb990f1

Browse files
committed
Add multi-column support to StringIndexer.
1 parent a6fc300 commit bb990f1

File tree

7 files changed

+336
-97
lines changed

7 files changed

+336
-97
lines changed

R/pkg/tests/fulltests/test_mllib_classification.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ test_that("spark.mlp", {
313313
# Test predict method
314314
mlpTestDF <- df
315315
mlpPredictions <- collect(select(predict(model, mlpTestDF), "prediction"))
316-
expect_equal(head(mlpPredictions$prediction, 6), c("1.0", "0.0", "0.0", "0.0", "0.0", "0.0"))
316+
expect_equal(head(mlpPredictions$prediction, 6), c("0.0", "1.0", "1.0", "1.0", "1.0", "1.0"))
317317

318318
# Test model save/load
319319
if (windows_with_hadoop()) {
@@ -348,12 +348,12 @@ test_that("spark.mlp", {
348348

349349
# Test random seed
350350
# default seed
351-
model <- spark.mlp(df, label ~ features, layers = c(4, 5, 4, 3), maxIter = 10)
351+
model <- spark.mlp(df, label ~ features, layers = c(4, 5, 4, 3), maxIter = 100)
352352
mlpPredictions <- collect(select(predict(model, mlpTestDF), "prediction"))
353353
expect_equal(head(mlpPredictions$prediction, 10),
354354
c("1.0", "1.0", "1.0", "1.0", "0.0", "1.0", "2.0", "2.0", "1.0", "0.0"))
355355
# seed equals 10
356-
model <- spark.mlp(df, label ~ features, layers = c(4, 5, 4, 3), maxIter = 10, seed = 10)
356+
model <- spark.mlp(df, label ~ features, layers = c(4, 5, 4, 3), maxIter = 100, seed = 10)
357357
mlpPredictions <- collect(select(predict(model, mlpTestDF), "prediction"))
358358
expect_equal(head(mlpPredictions$prediction, 10),
359359
c("1.0", "1.0", "1.0", "1.0", "0.0", "1.0", "2.0", "2.0", "1.0", "0.0"))

0 commit comments

Comments
 (0)