Class function returns more than one value (#1417)
Fix to a bug when the class function returns more than one value. In that case, the code will fail.
This commit is contained in:
parent
a8adf16228
commit
89c4f67f59
@ -54,7 +54,7 @@ xgb.DMatrix <- function(data, info = list(), missing = NA, ...) {
|
||||
# internal helper method
|
||||
xgb.get.DMatrix <- function(data, label = NULL, missing = NA, weight = NULL) {
|
||||
inClass <- class(data)
|
||||
if (inClass == "dgCMatrix" || inClass == "matrix") {
|
||||
if ("dgCMatrix" %in% inClass || "matrix" %in% inClass ) {
|
||||
if (is.null(label)) {
|
||||
stop("xgboost: need label when data is a matrix")
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user