convert S4 to S3; add some extra methods to DMatrix
This commit is contained in:
36
R-package/man/dimnames.xgb.DMatrix.Rd
Normal file
36
R-package/man/dimnames.xgb.DMatrix.Rd
Normal file
@@ -0,0 +1,36 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/xgb.DMatrix.R
|
||||
\name{dimnames.xgb.DMatrix}
|
||||
\alias{dimnames.xgb.DMatrix}
|
||||
\alias{dimnames<-.xgb.DMatrix}
|
||||
\title{Handling of column names of \code{xgb.DMatrix}}
|
||||
\usage{
|
||||
\method{dimnames}{xgb.DMatrix}(x)
|
||||
|
||||
\method{dimnames}{xgb.DMatrix}(x) <- value
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{object of class \code{xgb.DMatrix}}
|
||||
|
||||
\item{value}{a list of two elements: the first one is ignored
|
||||
and the second one is column names}
|
||||
}
|
||||
\description{
|
||||
Only column names are supported for \code{xgb.DMatrix}, thus setting of
|
||||
row names would have no effect and returnten row names would be NULL.
|
||||
}
|
||||
\details{
|
||||
Generic \code{dimnames} methods are used by \code{colnames}.
|
||||
Since row names are irrelevant, it is recommended to use \code{colnames} directly.
|
||||
}
|
||||
\examples{
|
||||
data(agaricus.train, package='xgboost')
|
||||
train <- agaricus.train
|
||||
dtrain <- xgb.DMatrix(train$data, label=train$label)
|
||||
dimnames(dtrain)
|
||||
colnames(dtrain)
|
||||
colnames(dtrain) <- make.names(1:ncol(train$data))
|
||||
print(dtrain, verbose=TRUE)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user