← Back to all sparks
M

mlr3

AI-ASSISTANTS
Velocity0.0

Machine learning framework for R

mlr3 is hardening the seams where its abstractions meet real learners

rmachine-learningerror-handlingencapsulationapi-cleanup
Current state
Releases arrive every few weeks and read as a systematic audit of the Learner interface. Recent versions added a native_model binding and a predict_raw flag so users can reach the underlying package's model and raw prediction, gave encapsulated learners a wall-clock deadline alongside the existing timeout, and removed the deprecated Task$divide(). A run of fixes addresses correctness at the boundary - factor level ordering that inverted binary probabilities, fallback learners losing state, misaligned probability columns.
Where it's heading
The framework is maturing from wrapping models to being accountable for what happens when wrapping goes wrong. Structured Mlr3Error and Mlr3Warning classes, conditions stored on the learner log, and messages replaced by conditions all point at making failures programmatically inspectable rather than printed. In parallel, escape hatches to the upstream model are being formalised instead of left to users digging into internals.
Prediction
Expect the remaining deprecated surface to follow Task$divide() out, and further work on encapsulation and fallback behaviour, which is where most recent fixes have clustered. The raw and native_model accessors suggest more of the upstream model will be surfaced deliberately.

Recent moves

  1. 2mo ago

    Fallback learner state and probability alignment fixes

    A fix release with real correctness weight: predict_newdata_fast() now restores the fallback learner's state and predict type after resample() and benchmark(), and aligns probability columns by class name so imputed predictions are no longer silently misassigned.

    View source ↗
  2. 2mo ago

    Encapsulated learners gain a deadline; Task$divide() removed

    Removes the deprecated Task$divide() as a breaking change and gives encapsulated learners a date-time deadline alongside the seconds-based timeout - a more usable control when training runs are scheduled rather than merely bounded.

    View source ↗
  3. 4mo ago

    Raw upstream predictions preserved; binary probability fix

    Adds a predict_raw flag and a raw field so the upstream model's own prediction object survives alongside the standardised one. Also fixes inverted binary probabilities caused by target factor levels being reordered between training and prediction.

    View source ↗
  4. 5mo ago

    Log messages replaced with conditions

    A single change replacing messages with conditions in logs. Small on its own, but part of the broader move to make diagnostics structured rather than printed.

    View source ↗
  5. 5mo ago

    native_model accessor and structured warning/error logs

    Adds a native_model binding for reaching the upstream package's model directly, stores warning and error conditions on the learner log, and stops allowing supervised tasks with missing target values.

    View source ↗
  6. 8mo ago

    Mlr3Error and Mlr3Warning classes introduced

    Introduces Mlr3Error and Mlr3Warning classes and an extra field for attaching additional data to prediction objects. The typed condition classes are the foundation the later logging changes build on.

    View source ↗