Github user NarineK commented on a diff in the pull request: https://github.com/apache/spark/pull/14384#discussion_r74551161 --- Diff: R/pkg/inst/tests/testthat/test_mllib.R --- @@ -454,4 +454,61 @@ test_that("spark.survreg", { } }) +test_that("spark.als", { + # R code to reproduce the result. + # + #' data <- list(list(0, 0, 4.0), list(0, 1, 2.0), list(1, 1, 3.0), list(1, 2, 4.0), + #' list(2, 1, 1.0), list(2, 2, 5.0)) + #' df <- createDataFrame(data, c("user", "item", "rating")) + #' model <- spark.als(df, ratingCol = "rating", userCol = "user", itemCol = "item", + #' rank = 10, maxIter = 5, seed = 0) + #' test <- createDataFrame(list(list(0, 2), list(1, 0), list(2, 0)), c("user", "item")) + #' predict(model, test) + # + # -- output of 'predict(model, data)' + # + # user item prediction --- End diff -- It would be good to have these examples also in method documentation. Also, how do you interpret negatively predicted rating ?
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org