Version 0.3.1 (to be yanked) and version 0.4 introduced a breaking change to MLJModelInterface.fit and MLJModelInterface.predict for all 5 models. This change only effects developers who directly call those functions. Regular MLJ users who interact through the usual "machine" interface are not affected.
What changed is that the models mentioned now implement the MLJModelInterface data-front end. The most likely reason for breakage is that fit and predict are not being called with the model-specific form of data generated by the reformat method. This post describes a backwards-compatible fix.
Adding the model-specific pre-processor reformat to your fit/predict calls
If you are not already using reformat in your fit and predict calls then, where you previously made a call
MMI.fit(model, verbosity, data...) # MMI = MLJModelInterface
you instead want
MMI.fit(model, verbosity, MMI.reformat(model, data...)...)
And instead of
MMI.predict(model, fitresult, Xnew)
you want
MMI.predict(model, fitresult, MMI.reformat(model, Xnew)...)
You have backwards compatibility because the fallback for reformat just slurps the data. This also means you can change these calls for all models (not just the DecisionTree ones).
Subsampling
If you subsample reformatted data before passing to fit or predict, you should always use subsampled_data = selectrows(model, I, reformatted_data...) where I is the indices for subsampling.
Version 0.3.1 (to be yanked) and version 0.4 introduced a breaking change to
MLJModelInterface.fitandMLJModelInterface.predictfor all 5 models. This change only effects developers who directly call those functions. Regular MLJ users who interact through the usual "machine" interface are not affected.What changed is that the models mentioned now implement the MLJModelInterface data-front end. The most likely reason for breakage is that
fitandpredictare not being called with the model-specific form of data generated by thereformatmethod. This post describes a backwards-compatible fix.Adding the model-specific pre-processor
reformatto yourfit/predictcallsIf you are not already using
reformatin yourfitandpredictcalls then, where you previously made a callyou instead want
And instead of
you want
You have backwards compatibility because the fallback for
reformatjust slurps the data. This also means you can change these calls for all models (not just the DecisionTree ones).Subsampling
If you subsample
reformatted data before passing tofitorpredict, you should always usesubsampled_data = selectrows(model, I, reformatted_data...)whereIis the indices for subsampling.