You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
The text was updated successfully, but these errors were encountered:
ablaom
changed the title
How to adapt to breaking change in fit and predict for DecisionTreeClassifier/DecisionTreeRegressor
How to adapt to breaking change in fit and predict for DecisionTree.jl models
Mar 1, 2023
Version 0.3.1 (to be yanked) and version 0.4 introduced a breaking change to
MLJModelInterface.fit
andMLJModelInterface.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
andpredict
are not being called with the model-specific form of data generated by thereformat
method. This post describes a backwards-compatible fix.Adding the model-specific pre-processor
reformat
to yourfit
/predict
callsIf you are not already using
reformat
in yourfit
andpredict
calls then, where you previously made a callyou instead want
And instead of
you want
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
reformat
ted data before passing tofit
orpredict
, you should always usesubsampled_data = selectrows(model, I, reformatted_data...)
whereI
is the indices for subsampling.The text was updated successfully, but these errors were encountered: