% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lgb.Dataset.R \name{lgb.Dataset} \alias{lgb.Dataset} \title{Construct lgb.Dataset object} \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{ Construct lgb.Dataset object from dense matrix, sparse matrix or local file (that was created previously by saving an \code{lgb.Dataset}). } \examples{ \dontrun{ 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) } }