diff --git a/R-package/DESCRIPTION b/R-package/DESCRIPTION index 1ae744967..fcc917b21 100644 --- a/R-package/DESCRIPTION +++ b/R-package/DESCRIPTION @@ -52,7 +52,9 @@ Suggests: vcd (>= 1.3), testthat, lintr, - igraph (>= 1.0.1) + igraph (>= 1.0.1), + jsonlite, + float Depends: R (>= 3.3.0) Imports: diff --git a/R-package/cleanup b/R-package/cleanup index 912a57977..eb8669970 100755 --- a/R-package/cleanup +++ b/R-package/cleanup @@ -1,3 +1,4 @@ #!/bin/sh rm -f src/Makevars +rm -f CMakeLists.txt diff --git a/R-package/tests/testthat/test_callbacks.R b/R-package/tests/testthat/test_callbacks.R index 11275d80a..59daaf448 100644 --- a/R-package/tests/testthat/test_callbacks.R +++ b/R-package/tests/testthat/test_callbacks.R @@ -236,7 +236,7 @@ test_that("early stopping using a specific metric works", { expect_equal(length(pred), 1611) logloss_pred <- sum(-ltest * log(pred) - (1 - ltest) * log(1 - pred)) / length(ltest) logloss_log <- bst$evaluation_log[bst$best_iteration, test_logloss] - expect_equal(logloss_log, logloss_pred, tolerance = 5e-6) + expect_equal(logloss_log, logloss_pred, tolerance = 1e-5) }) test_that("early stopping xgb.cv works", { diff --git a/R-package/vignettes/xgboostfromJSON.Rmd b/R-package/vignettes/xgboostfromJSON.Rmd index 046902b0f..492f3a77b 100644 --- a/R-package/vignettes/xgboostfromJSON.Rmd +++ b/R-package/vignettes/xgboostfromJSON.Rmd @@ -70,7 +70,7 @@ First let's dump the model to JSON: ```{r} bst_json <- xgb.dump(bst, with_stats = FALSE, dump_format='json') -bst_from_json <- jsonlite::fromJSON(bst_json, simplifyDataFrame = FALSE) +bst_from_json <- fromJSON(bst_json, simplifyDataFrame = FALSE) node <- bst_from_json[[1]] cat(bst_json) ``` @@ -186,4 +186,4 @@ bst_from_json_preds <- ifelse(fl(data$dates)