expose setinfo
This commit is contained in:
parent
9e05db7261
commit
8ad9293437
25
R-package/R/setinfo.xgb.DMatrix.R
Normal file
25
R-package/R/setinfo.xgb.DMatrix.R
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#' Set information of an xgb.DMatrix object
|
||||||
|
#'
|
||||||
|
#' Set information of an xgb.DMatrix object
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' data(iris)
|
||||||
|
#' iris[,5] <- as.numeric(iris[,5]=='setosa')
|
||||||
|
#' dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5])
|
||||||
|
#' labels <- getinfo(dtrain, "label")
|
||||||
|
#' @rdname setinfo
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
setinfo <- function(object, ...){
|
||||||
|
UseMethod("setinfo")
|
||||||
|
}
|
||||||
|
|
||||||
|
#' @param object Object of class "xgb.DMatrix"
|
||||||
|
#' @param name the name of the field to get
|
||||||
|
#' @param ... other parameters
|
||||||
|
#' @rdname getinfo
|
||||||
|
#' @method getinfo xgb.DMatrix
|
||||||
|
setMethod("setinfo", signature = "xgb.DMatrix",
|
||||||
|
definition = function(object, name, info) {
|
||||||
|
xgb.setinfo(object, name, info)
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user