Github user yanboliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/15910#discussion_r88777658
--- Diff: R/pkg/inst/tests/testthat/test_mllib.R ---
@@ -674,6 +674,16 @@ test_that("spark.logit", {
expect_error(summary(blr_model2))
unlink(modelPath)
+ # test prediction label as text
+ training <- suppressWarnings(createDataFrame(iris))
+ binomial_training <- training[training$Species %in% c("versicolor",
"virginica"), ]
+ binomial_model <- spark.logit(binomial_training, Species ~ Sepal_Length
+ Sepal_Width)
+ prediction <- predict(binomial_model, binomial_training)
+ expect_equal(typeof(take(select(prediction, "prediction"),
1)$prediction), "character")
+ expected <- c("virginica", "virginica", "virginica", "versicolor",
"virginica",
+ "versicolor", "virginica", "versicolor", "virginica",
"versicolor")
+ expect_equal(as.list(take(select(prediction, "prediction"), 10))[[1]],
expected)
--- End diff --
Theoretically, the order is not guaranteed. However, we did similar work
from the first test case of mllib.R, but never had a problem until now. I'd
like to enforce the tests here and other places, but may be in a separate work
should be better since it involves lots of other tests?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]