Running examples in 'brulee-Ex.R' failed
The error most likely occurred in:

> ### Name: brulee_logistic_reg
> ### Title: Fit a logistic regression model
> ### Aliases: brulee_logistic_reg brulee_logistic_reg.default
> ###   brulee_logistic_reg.data.frame brulee_logistic_reg.matrix
> ###   brulee_logistic_reg.formula brulee_logistic_reg.recipe
> 
> ### ** Examples
> 
> if (torch::torch_is_installed()) {
+ 
+  library(recipes)
+  library(yardstick)
+ 
+  ## -----------------------------------------------------------------------------
+  # increase # epochs to get better results
+ 
+  data(cells, package = "modeldata")
+ 
+  cells$case <- NULL
+ 
+  set.seed(122)
+  in_train <- sample(1:nrow(cells), 1000)
+  cells_train <- cells[ in_train,]
+  cells_test  <- cells[-in_train,]
+ 
+  # Using matrices
+  set.seed(1)
+  brulee_logistic_reg(x = as.matrix(cells_train[, c("fiber_width_ch_1", "width_ch_1")]),
+                       y = cells_train$class,
+                       penalty = 0.10, epochs = 3)
+ 
+  # Using recipe
+  library(recipes)
+ 
+  cells_rec <-
+   recipe(class ~ ., data = cells_train) %>%
+   # Transform some highly skewed predictors
+   step_YeoJohnson(all_numeric_predictors()) %>%
+   step_normalize(all_numeric_predictors()) %>%
+   step_pca(all_numeric_predictors(), num_comp = 10)
+ 
+  set.seed(2)
+  fit <- brulee_logistic_reg(cells_rec, data = cells_train,
+                              penalty = .01, epochs = 5)
+  fit
+ 
+  autoplot(fit)
+ 
+  library(yardstick)
+  predict(fit, cells_test, type = "prob") %>%
+   bind_cols(cells_test) %>%
+   roc_auc(class, .pred_PS)
+ }
Loading required package: dplyr

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union


Attaching package: 'recipes'

The following object is masked from 'package:stats':

    step

For binary classification, the first factor level is assumed to be the event.
Use the argument `event_level = "second"` to alter this as needed.
Error in torch_tensor_cpp(data, dtype, device, requires_grad, pin_memory) : 
  Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
Calls: brulee_logistic_reg ... <Anonymous> -> <Anonymous> -> <Anonymous> -> torch_tensor_cpp
Execution halted