fix a tiny bug in xgboost
This commit is contained in:
parent
b151617ac1
commit
114cfb2167
@ -6,7 +6,7 @@ xgboost <- function(data = NULL, label = NULL, params = list(), nrounds = 10,
|
|||||||
if (inClass == "dgCMatrix" || inClass == "matrix") {
|
if (inClass == "dgCMatrix" || inClass == "matrix") {
|
||||||
if (is.null(label))
|
if (is.null(label))
|
||||||
stop("xgboost: need label when data is a matrix")
|
stop("xgboost: need label when data is a matrix")
|
||||||
dtrain <- xgb.DMatrix(data, label = y)
|
dtrain <- xgb.DMatrix(data, label = label)
|
||||||
} else {
|
} else {
|
||||||
if (!is.null(label))
|
if (!is.null(label))
|
||||||
warning("xgboost: label will be ignored.")
|
warning("xgboost: label will be ignored.")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user