[FIX] Calibration model: Work with numpy data #5159
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Calibration models do not support passing NumPy data since their
data_to_model_domain
does not transform data correctly. It should take into account the base model domain. The error is that the calibration model stores the wrong domain. It first sets the base_learners domain, but it is then overwritten with the wrong (not preprocessed) domain.This code snipet works with other models but not with callibrations:
The correction would support explain the model on calibration learner.
Description of changes
This PR fixes the base learner such that it does not overwrite the domain of models that already set it. It only set the domain for other models (mostly SKL models).
If it looks ugly this error could be also resolved by completely removing the line that set the domain. Then all models would need to pass the domain to the model's constructor. It would be a major change in models and learners.
Includes