Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix flaky test R (#9598)
Browse files Browse the repository at this point in the history
* fix flaky test R

* fix flaky test R
  • Loading branch information
jeremiedb authored and szha committed Jan 27, 2018
1 parent ee61078 commit e465cfa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions R-package/tests/testthat/test_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down

0 comments on commit e465cfa

Please sign in to comment.