You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/01/27 13:47:38 UTC

[GitHub] szha closed pull request #9598: Fix flaky test R

szha closed pull request #9598: Fix flaky test R
URL: https://github.com/apache/incubator-mxnet/pull/9598
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/R-package/tests/testthat/test_model.R b/R-package/tests/testthat/test_model.R
index 8cdd396c25..13e54ff9ce 100644
--- a/R-package/tests/testthat/test_model.R
+++ b/R-package/tests/testthat/test_model.R
@@ -172,9 +172,14 @@ test_that("Fine-tune", {
 })                                       
 
 test_that("Matrix Factorization", {
-  GetMovieLens()
-  DF <- read.table("./data/ml-100k/u.data", header = F, sep = "\t")
-  names(DF) <- c("user", "item", "score", "time")
+  
+  # Use fake random data instead of GetMovieLens() to remove external dependency
+  set.seed(123)
+  user <- sample(943, size = 100000, replace = T)
+  item <- sample(1682, size = 100000, replace = T)
+  score <- sample(5, size = 100000, replace = T)
+  DF <- data.frame(user, item, score)
+  
   max_user <- max(DF$user)
   max_item <- max(DF$item)
   DF_mat_x <- data.matrix(t(DF[, 1:2]))


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services