# \[ANN\] MLJ now has iteration control and model stacking

**URL:** https://discourse.julialang.org/t/ann-mlj-now-has-iteration-control-and-model-stacking/63726
**Category:** Package Announcements
**Tags:** optimization, machine-learning, mlj
**Created:** [June 29, 2021, 5:36am UTC](https://discourse.julialang.org/t/ann-mlj-now-has-iteration-control-and-model-stacking/63726 "2021-06-29T05:36:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)
#### Post date: [June 29, 2021, 5:36am UTC](https://discourse.julialang.org/t/ann-mlj-now-has-iteration-control-and-model-stacking/63726/1 "2021-06-29T05:36:51Z")

</div>

Announcing two significant enhancements to the multi-paradigm machine learning framework [MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/).

## A model wrapper for controlling iterative models

By wrapping a model using [`IterativeModel(model=...)`](https://alan-turing-institute.github.io/MLJ.jl/dev/controlling_iterative_models/) one can control the model externally, enabling features such as **early stopping** (based on an out-of-sample loss), **saving model snapshots** , and **tracking learned parameters**. As a wrapper, iterative model control is composable with other MLJ meta-algorithms, such as hyper-parameter optimization.

The wrapper, documented [here](https://alan-turing-institute.github.io/MLJ.jl/dev/controlling_iterative_models/), is based on generic iterative control provided by [IterationControl.jl](https://github.com/JuliaAI/IterationControl.jl)

### Learning more

For a little more detail, see our [JuliaCon2021 poster](https://github.com/JuliaAI/MLJIteration.jl/blob/dev/publications/JuliaCon2021_poster.pdf).

For a detailed demonstration of the wrapper on the MNIST image dataset, see [here](https://github.com/FluxML/MLJFlux.jl/tree/dev/examples/mnist).

## Model stacking

Using MLJ’s new [`Stack`](https://alan-turing-institute.github.io/MLJ.jl/dev/composing_models/#Model-Stacking) constructor, one can blend the predictions of multiple models, with the help of an adjudicating model. Model stacking, as introduced by [Wolpert (1992)](https://www.sciencedirect.com/science/article/abs/pii/S0893608005800231), is popular in machine learning competitions. In the Biostats community, a model stack is also known as a _super model_ ([Van der Laan et al (2007)](https://biostats.bepress.com/ucbbiostat/paper222/)).

Thanks to Oliver Labayle @olivierlabayle for adding this constructor.

### Learning more

For a quick start, see the [MLJ documentation](https://alan-turing-institute.github.io/MLJ.jl/dev/composing_models/#Model-Stacking).

To learn more about how stacking works, and how stacking is implemented using MLJ’s generic model composition API, see [this tutorial](https://alan-turing-institute.github.io/DataScienceTutorials.jl/getting-started/stacking/).
