[FIX] Fix dimensionality of probabilities from values #4629
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
SGD (same than some other models) outputs wrong shapes of probabilities when those retrieved from values (when skl_learner do not provide probabilities). The issue is caused by the one_hot encoding function that does not consider a number of values in the domain.
SGD (skl_learner) for some of the losses provides probabilities that are not used by Orange since it uses custom predict function.
Description of changes
one_hot
function changed to acceptdim
parameter which tells what must be a resulting number of columns__call__
function for model callsone_hot
with adim
parameter that has a number of values in the domain as a shape.Includes