lgb.Dataset.set.categorical.Rd 782 Bytes
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.set.categorical}
\alias{lgb.Dataset.set.categorical}
5
\title{Set categorical feature of \code{lgb.Dataset}}
Guolin Ke's avatar
Guolin Ke committed
6
7
8
9
10
11
12
13
14
15
16
17
\usage{
lgb.Dataset.set.categorical(dataset, categorical_feature)
}
\arguments{
\item{dataset}{object of class \code{lgb.Dataset}}

\item{categorical_feature}{categorical features}
}
\value{
passed dataset
}
\description{
18
Set categorical feature of \code{lgb.Dataset}
Guolin Ke's avatar
Guolin Ke committed
19
20
}
\examples{
21
\dontrun{
22
23
24
25
26
27
28
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.set.categorical(dtrain, 1:2)
29
}
30

Guolin Ke's avatar
Guolin Ke committed
31
32
}