Burak Dilber
Burak Dilber

Reputation: 11

lightgbm engine in tidymodels

When I want to use the lightgbm engine for the boost_tree function in the parsnip package, I get an error like this:

lgbm_model <- 
  boost_tree( mode = "classification",
              mtry = tune(),
              trees = tune(),
              min_n = tune(),
              tree_depth = tune(),
              learn_rate = tune(),
              loss_reduction = tune(),
              engine = "lightgbm"
  )

error:

Error in check_spec_mode_engine_val(): ! Engine 'lightgbm' is not supported for boost_tree(). See show_engines('boost_tree'). Run rlang::last_error() to see where the error occurred.

What could this problem be related to?

Upvotes: 0

Views: 686

Answers (1)

Shaahin
Shaahin

Reputation: 27

The show_engines('boost_tree') shows the available engines for the model boost_tree():

engine mode

1 xgboost classification 2 xgboost regression
3 C5.0 classification 4 spark classification 5 spark regression

As we can see, there is no lightgbm engine here, therefore it cannot be used as an engine input.

The solution is adding the new engine to the parsnip. You can read about how to do so here

Upvotes: -1

Related Questions