fix iris to Rd files
This commit is contained in:
@@ -21,7 +21,7 @@ Get information of an xgb.DMatrix object
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
iris[,5] <- as.numeric(iris[,5])
|
||||
iris[,5] <- as.numeric(iris[,5]=='setosa')
|
||||
dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5])
|
||||
labels <- getinfo(dtrain, "label")
|
||||
}
|
||||
|
||||
@@ -18,15 +18,16 @@ value of sum of functions, when outputmargin=TRUE, the prediction is
|
||||
untransformed margin value. In logistic regression, outputmargin=T will
|
||||
output value before logistic transformation.}
|
||||
|
||||
\item{ntreelimit}{limit number of trees used in prediction, this parameter is only valid for gbtree, but not for gblinear.
|
||||
set it to be value bigger than 0. It will use all trees by default.}
|
||||
\item{ntreelimit}{limit number of trees used in prediction, this parameter is
|
||||
only valid for gbtree, but not for gblinear. set it to be value bigger
|
||||
than 0. It will use all trees by default.}
|
||||
}
|
||||
\description{
|
||||
Predicted values based on xgboost model object.
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]=='setosa'), nrounds = 2)
|
||||
pred <- predict(bst, as.matrix(iris[,1:4]))
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ orginal xgb.DMatrix object
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
iris[,5] <- as.numeric(iris[,5])
|
||||
iris[,5] <- as.numeric(iris[,5]=='setosa')
|
||||
dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5])
|
||||
dsub <- slice(dtrain, 1:3)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ Contruct xgb.DMatrix object from dense matrix, sparse matrix or local file.
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
iris[,5] <- as.numeric(iris[,5])
|
||||
iris[,5] <- as.numeric(iris[,5]=='setosa')
|
||||
dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5])
|
||||
xgb.DMatrix.save(dtrain, 'iris.xgb.DMatrix')
|
||||
dtrain <- xgb.DMatrix('iris.xgb.DMatrix')
|
||||
|
||||
@@ -15,7 +15,7 @@ Save xgb.DMatrix object to binary file
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
iris[,5] <- as.numeric(iris[,5])
|
||||
iris[,5] <- as.numeric(iris[,5]=='setosa')
|
||||
dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5])
|
||||
xgb.DMatrix.save(dtrain, 'iris.xgb.DMatrix')
|
||||
dtrain <- xgb.DMatrix('iris.xgb.DMatrix')
|
||||
|
||||
@@ -21,7 +21,7 @@ Save a xgboost model to text file. Could be parsed later.
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]=='setosa'), nrounds = 2)
|
||||
xgb.dump(bst, 'iris.xgb.model.dump')
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ Load xgboost model from the binary model file
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]=='setosa'), nrounds = 2)
|
||||
xgb.save(bst, 'iris.xgb.model')
|
||||
bst <- xgb.load('iris.xgb.model')
|
||||
pred <- predict(bst, as.matrix(iris[,1:4]))
|
||||
|
||||
@@ -15,7 +15,7 @@ Save xgboost model from xgboost or xgb.train
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]=='setosa'), nrounds = 2)
|
||||
xgb.save(bst, 'iris.xgb.model')
|
||||
bst <- xgb.load('iris.xgb.model')
|
||||
pred <- predict(bst, as.matrix(iris[,1:4]))
|
||||
|
||||
@@ -56,7 +56,7 @@ therefore it is more flexible than \code{\link{xgboost}}.
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
iris[,5] <- as.numeric(iris[,5])
|
||||
iris[,5] <- as.numeric(iris[,5]=='setosa')
|
||||
dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5])
|
||||
dtest <- dtrain
|
||||
watchlist <- list(eval = dtest, train = dtrain)
|
||||
|
||||
@@ -46,7 +46,7 @@ Number of threads can also be manually specified via "nthread" parameter
|
||||
}
|
||||
\examples{
|
||||
data(iris)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]), nrounds = 2)
|
||||
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]=='setosa'), nrounds = 2)
|
||||
pred <- predict(bst, as.matrix(iris[,1:4]))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user