lgb.Dataset.Rd 1.26 KB
Newer Older
Guolin Ke's avatar
Guolin Ke committed
1
2
3
4
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lgb.Dataset.R
\name{lgb.Dataset}
\alias{lgb.Dataset}
wxchan's avatar
wxchan committed
5
\title{Construct lgb.Dataset object}
Guolin Ke's avatar
Guolin Ke committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\usage{
lgb.Dataset(data, params = list(), reference = NULL, colnames = NULL,
  categorical_feature = NULL, free_raw_data = TRUE, info = list(), ...)
}
\arguments{
\item{data}{a \code{matrix} object, a \code{dgCMatrix} object or a character representing a filename}

\item{params}{a list of parameters}

\item{reference}{reference dataset}

\item{colnames}{names of columns}

\item{categorical_feature}{categorical features}

\item{free_raw_data}{TRUE for need to free raw data after construct}

\item{info}{a list of information of the lgb.Dataset object}

\item{...}{other information to pass to \code{info} or parameters pass to \code{params}}
}
\value{
constructed dataset
}
\description{
wxchan's avatar
wxchan committed
31
Construct lgb.Dataset object from dense matrix, sparse matrix
Guolin Ke's avatar
Guolin Ke committed
32
33
34
or local file (that was created previously by saving an \code{lgb.Dataset}).
}
\examples{
35
\dontrun{
36
37
38
39
40
41
42
library(lightgbm)
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
lgb.Dataset.save(dtrain, "lgb.Dataset.data")
dtrain <- lgb.Dataset("lgb.Dataset.data")
lgb.Dataset.construct(dtrain)
43
}
44

Guolin Ke's avatar
Guolin Ke committed
45
46
}