[R] Enable weighted learning to rank (#5945)
* [R] enable weighted learning to rank * Add R unit test for ranking * Fix lint
This commit is contained in:
committed by
GitHub
parent
ace7fd328b
commit
6347fa1c2e
@@ -257,8 +257,6 @@ setinfo.xgb.DMatrix <- function(object, name, info, ...) {
|
||||
return(TRUE)
|
||||
}
|
||||
if (name == "weight") {
|
||||
if (length(info) != nrow(object))
|
||||
stop("The length of weights must equal to the number of rows in the input data")
|
||||
.Call(XGDMatrixSetInfo_R, object, name, as.numeric(info))
|
||||
return(TRUE)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user