如何从lightgbm模型IN R中绘制决策树?

时间:2018-08-21 13:16:35

标签: r lightgbm

如何绘制lightgbm决策树?我到处搜索,但找不到解决方案。这是模型的示例:

data(agaricus.train, package = "lightgbm")
train <- agaricus.train

dtrain <- lgb.Dataset(train$data, label = train$label)

data(agaricus.test, package = "lightgbm")

test <- agaricus.test

dtest <- lgb.Dataset.create.valid(dtrain, test$data, label = test$label)

params <- list(objective = "regression", metric = "l2")

valids <- list(test = dtest)

model <- lgb.train(params,
               dtrain,
               100,
               valids,
               min_data = 1,
               learning_rate = 1,
               early_stopping_rounds = 10)

0 个答案:

没有答案