---
title: "Initialization"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Initialization}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r install, eval=FALSE}
# Install the Python backend (only needs to be done once). 
leaf::install_leaf()
```

```{r}
# Load package 
library(leaf)
if (!backend_available()) {
  message("Install backend with leaf::install_leaf()")
}  
``` 

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  eval = backend_available()
)
```

```{r main, eval=TRUE, error=TRUE}
# Initialize the symbolic regressor
regressor = leaf::SymbolicRegressor$new(
  engine = "rsrm", 
  loss = 'PoissonDeviance', 
  num_iterations = 3,
  base = list(verbose = FALSE)
)
```
