## ----install, eval=FALSE------------------------------------------------------
# # Install the Python backend (only needs to be done once).
# leaf::install_leaf()

## -----------------------------------------------------------------------------
# Load package 
library(leaf)
if (!backend_available()) {
  message("Install backend with leaf::install_leaf()")
}  

## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  eval = backend_available()
)

## ----main, eval=TRUE, error=TRUE----------------------------------------------
try({
# Initialize the symbolic regressor
regressor = leaf::SymbolicRegressor$new(
  engine = "rsrm", 
  loss = 'PoissonDeviance', 
  num_iterations = 3,
  base = list(verbose = FALSE)
)
})

