Merge pull request #152 from pommedeterresautee/master
Fix global variable message (Cran Checks)
This commit is contained in:
commit
da9f0989c6
3
.gitignore
vendored
3
.gitignore
vendored
@ -52,4 +52,5 @@ xgboost.mpi
|
|||||||
xgboost.mock
|
xgboost.mock
|
||||||
train*
|
train*
|
||||||
rabit
|
rabit
|
||||||
|
.Rbuildignore
|
||||||
|
R-package.Rproj
|
||||||
|
|||||||
@ -130,3 +130,8 @@ xgb.cv <- function(params=list(), data, nrounds, nfold, label = NULL, missing =
|
|||||||
}
|
}
|
||||||
return(dt)
|
return(dt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Avoid error messages during CRAN check.
|
||||||
|
# The reason is that these variables are never declared
|
||||||
|
# They are mainly column names inferred by Data.table...
|
||||||
|
globalVariables(".")
|
||||||
@ -55,3 +55,8 @@ xgb.dump <- function(model = NULL, fname = NULL, fmap = "", with.stats=FALSE) {
|
|||||||
return(TRUE)
|
return(TRUE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Avoid error messages during CRAN check.
|
||||||
|
# The reason is that these variables are never declared
|
||||||
|
# They are mainly column names inferred by Data.table...
|
||||||
|
globalVariables(".")
|
||||||
@ -81,3 +81,8 @@ treeDump <- function(feature_names, text){
|
|||||||
linearDump <- function(feature_names, text){
|
linearDump <- function(feature_names, text){
|
||||||
which(text == "weight:") %>% {a=.+1;text[a:length(text)]} %>% as.numeric %>% data.table(Feature = feature_names, Weight = .)
|
which(text == "weight:") %>% {a=.+1;text[a:length(text)]} %>% as.numeric %>% data.table(Feature = feature_names, Weight = .)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Avoid error messages during CRAN check.
|
||||||
|
# The reason is that these variables are never declared
|
||||||
|
# They are mainly column names inferred by Data.table...
|
||||||
|
globalVariables(".")
|
||||||
@ -162,3 +162,8 @@ xgb.model.dt.tree <- function(feature_names = NULL, filename_dump = NULL, model
|
|||||||
|
|
||||||
allTrees
|
allTrees
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Avoid error messages during CRAN check.
|
||||||
|
# The reason is that these variables are never declared
|
||||||
|
# They are mainly column names inferred by Data.table...
|
||||||
|
globalVariables(c("ID", "Tree", "Yes", ".", ".N", "Feature", "Cover", "Quality", "No", "Gain", "Frequence"))
|
||||||
@ -87,3 +87,8 @@ xgb.plot.tree <- function(feature_names = NULL, filename_dump = NULL, model = NU
|
|||||||
path <- allTrees[Feature!="Leaf", c(yesPath, noPath)] %>% .[order(.)] %>% paste(sep = "", collapse = ";") %>% paste("graph LR", .,collapse = "", sep = ";") %>% paste(CSSstyle, yes, no, sep = ";")
|
path <- allTrees[Feature!="Leaf", c(yesPath, noPath)] %>% .[order(.)] %>% paste(sep = "", collapse = ";") %>% paste("graph LR", .,collapse = "", sep = ";") %>% paste(CSSstyle, yes, no, sep = ";")
|
||||||
DiagrammeR(path, width, height)
|
DiagrammeR(path, width, height)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Avoid error messages during CRAN check.
|
||||||
|
# The reason is that these variables are never declared
|
||||||
|
# They are mainly column names inferred by Data.table...
|
||||||
|
globalVariables(c("Feature", "yesPath", "ID", "Cover", "Quality", "Split", "Yes", "Yes.Feature", "noPath", "No", "No.Feature", "."))
|
||||||
@ -153,7 +153,8 @@ class ColMaker: public IUpdater {
|
|||||||
}
|
}
|
||||||
unsigned n = static_cast<unsigned>(param.colsample_bytree * feat_index.size());
|
unsigned n = static_cast<unsigned>(param.colsample_bytree * feat_index.size());
|
||||||
random::Shuffle(feat_index);
|
random::Shuffle(feat_index);
|
||||||
utils::Check(n > 0, "colsample_bytree is too small that no feature can be included");
|
//utils::Check(n > 0, "colsample_bytree is too small that no feature can be included");
|
||||||
|
utils::Check(n > 0, "colsample_bytree=%g is too small that no feature can be included", param.colsample_bytree);
|
||||||
feat_index.resize(n);
|
feat_index.resize(n);
|
||||||
}
|
}
|
||||||
{// setup temp space for each thread
|
{// setup temp space for each thread
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user