From 8bf229986db6fb452be3ad44e915c6f4125068a3 Mon Sep 17 00:00:00 2001 From: Laurae Date: Wed, 6 Feb 2019 23:25:09 +0100 Subject: [PATCH] Fix #1988 missing file issue --- R-package/demo/categorical_features_rules.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R-package/demo/categorical_features_rules.R b/R-package/demo/categorical_features_rules.R index 6ac2eb1ce589..27504022842e 100644 --- a/R-package/demo/categorical_features_rules.R +++ b/R-package/demo/categorical_features_rules.R @@ -69,7 +69,8 @@ my_data_test <- as.matrix(bank_test[, 1:16, with = FALSE]) # Creating the LightGBM dataset with categorical features # The categorical features can be passed to lgb.train to not copy and paste a lot dtrain <- lgb.Dataset(data = my_data_train, - label = bank_train$y) + label = bank_train$y, + categorical_feature = c(2, 3, 4, 5, 7, 8, 9, 11, 16)) dtest <- lgb.Dataset.create.valid(dtrain, data = my_data_test, label = bank_test$y) @@ -81,8 +82,7 @@ model <- lgb.train(list(objective = "binary", learning_rate = 0.1, min_data = 0, min_hessian = 1, - max_depth = 2, - categorical_feature = c(2, 3, 4, 5, 7, 8, 9, 11, 16)), + max_depth = 2), dtrain, 100, valids = list(train = dtrain, valid = dtest))