# \[ANN\] EvoTrees.jl v0.17 - API update (and breaking changes)

**URL:** https://discourse.julialang.org/t/ann-evotrees-jl-v0-17-api-update-and-breaking-changes/126234
**Category:** Package Announcements
**Created:** [February 24, 2025, 5:39am UTC](https://discourse.julialang.org/t/ann-evotrees-jl-v0-17-api-update-and-breaking-changes/126234 "2025-02-24T05:39:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jeremiedb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeremiedb/32/29150_2.png) [@jeremiedb](https://discourse.julialang.org/u/jeremiedb)
#### Post date: [February 24, 2025, 5:39am UTC](https://discourse.julialang.org/t/ann-evotrees-jl-v0-17-api-update-and-breaking-changes/126234/1 "2025-02-24T05:39:11Z")

</div>

Below are key changes with upcoming v0.17 release.  
It’s yet to be registered in General, and for now available through [main](https://github.com/Evovest/EvoTrees.jl/tree/main) branch, so changes could still be brought if some design choices appear problematic.

The general objective with the API changes was to get improved alignement with the [`MLJ`](https://github.com/JuliaAI/MLJ.jl) (and potentially [`LearnAPI`](https://github.com/JuliaAI)) scope for model constructor/learner, and `fit` method. Also, improve consistency with [`NeuroTreeModels`](https://github.com/Evovest/NeuroTreeModels.jl)

## Breaking changes:

#### Model constructors (`EvoTreeRegressor`, `EvoTreeClassifier`…) now include the following arguments:

- `metric`: the evaluation metric to be tracked
- `early_stopping_rounds`
- `device`: either `:cpu` or `:gpu`

Example:

```julia
config = EvoTreeRegressor(; loss=:mse, metric=:mae, early_stopping_rounds=10, device=:gpu)

```

#### Deprecation of `fit_evotree` in favor of import of MLJModelInterface `fit` :

Note that `fit_evotree` results in a call to `fit`.  
The following legacy kwargs of `fit_evotree` will be ignored:

- `metric`
- `return_logger`
- `early_stopping_rounds`
- `device`

```julia
m = fit_evotree(config, dtrain; target_name="y", feature_names=["x1", "x2"]) #old 
m = fit(config, dtrain; target_name="y", feature_names=["x1", "x2"]) #new

```

#### Changes in the naming of variables identity in the Tables / DataFrames based internal API, which were previously kwargs of `fit_evotree`:

- `fnames` =\> `feature_names`
- `w_name` =\> `weight_names`

```julia
m = fit_evotree(config, dtrain; target_name="y", feature_names=["x1", "x2"])

```

#### The `logger`, which tracks metrics on eval data through the iterations, is now automatically included in a fitted model `info` field

```julia
m = fit(config, dtrain; target_name="y", feature_names=["x1", "x2"], deval)
logger = m.info[:logger]

```

#### Changes related to losses:

- `L1` / `l1` loss is no longer supported. Use `loss=:mae` in `EvoTreeRegressor` instead.

#### Constructors are not longer parametrics: EvoTreeRegressor{L\<:ModelType} =\> EvoTreeRegressor

This one shouldn’t affect user’s experience.

## Fixes and improvements to GPU:

- Models trained through MLJ now support the :gpu argument (passed through the constructor like `EvoTreeRegressor` as showned above).
- Inference is now properly dispatch to :gpu when using: `m(dtrain; device=:gpu)`
- Both `:mae` and `:quantile` losses are now now suported on GPU (`device = :gpu`)
