slice.Rd 776 Bytes
Newer Older
Guolin Ke's avatar
Guolin Ke committed
1
2
3
4
5
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lgb.Dataset.R
\name{slice}
\alias{slice}
\alias{slice.lgb.Dataset}
6
\title{Slice a dataset}
Guolin Ke's avatar
Guolin Ke committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
\usage{
slice(dataset, ...)

\method{slice}{lgb.Dataset}(dataset, idxset, ...)
}
\arguments{
\item{dataset}{Object of class "lgb.Dataset"}

\item{...}{other parameters (currently not used)}

\item{idxset}{a integer vector of indices of rows needed}
}
\value{
constructed sub dataset
}
\description{
23
Get a new \code{lgb.Dataset} containing the specified rows of
Guolin Ke's avatar
Guolin Ke committed
24
25
26
orginal lgb.Dataset object
}
\examples{
27
28
29
30
\dontrun{
  data(agaricus.train, package='lightgbm')
  train <- agaricus.train
  dtrain <- lgb.Dataset(train$data, label=train$label)
Guolin Ke's avatar
Guolin Ke committed
31

32
33
34
  dsub <- slice(dtrain, 1:42)
  labels1 <- getinfo(dsub, 'label')
}
Guolin Ke's avatar
Guolin Ke committed
35
36
}