[R-package] JSON dump format and a couple of bugfixes (#1855)

* [R-package] JSON tree dump interface

* [R-package] precision bugfix in xgb.attributes

* [R-package] bugfix for cb.early.stop called from xgb.cv

* [R-package] a bit more clarity on labels checking in xgb.cv

* [R-package] test JSON dump for gblinear as well

* whitespace lint
This commit is contained in:
Vadim Khotilovich
2016-12-11 12:48:39 -06:00
committed by Tianqi Chen
parent 0268dedeea
commit b21e658a02
10 changed files with 72 additions and 22 deletions

View File

@@ -339,7 +339,7 @@ xgb.attributes <- function(object) {
# Q: should we warn a user about non-scalar elements?
a <- lapply(a, function(x) {
if (is.null(x)) return(NULL)
if (is.numeric(value[1])) {
if (is.numeric(x[1])) {
format(x[1], digits = 17)
} else {
as.character(x[1])