Set categorical feature of lgb.Dataset

lgb.Dataset.set.categorical(dataset, categorical_feature)

Arguments

dataset

object of class lgb.Dataset

categorical_feature

categorical features

Value

passed dataset

Examples

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)