MultiOutputClassifier should have `decision_function`
See original GitHub issueDescribe the workflow you want to enable
We should be able to use MultiOutputClassifier
as (essentially) a drop-in replacement for the underlying classifiers. Right now it has the functions predict
and predict_proba
(if defined in the underlying predictors) but missing decision_function
(e.g. for svm).
Describe your proposed solution
Use exactly the same code as predict_proba
:
https://github.com/scikit-learn/scikit-learn/blob/ec48b246785f37f3d976693c03dc5a3702ccedde/sklearn/multioutput.py#L450
but for decision_function
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
1.12. Multiclass and multioutput algorithms - Scikit-learn
This section of the user guide covers functionality related to multi-learning problems, including multiclass, multilabel, and multioutput classification and ...
Read more >sklearndf.classification.MultiOutputClassifierDF
Compute the decision function for the given inputs. The inputs must have the same features as the inputs used to fit this learner....
Read more >Why do predictions and scores return different results in ...
For multilabel classification you should use y_pred_ = np.where(classifier.decision_function(X_test) > 0, 1, 0).
Read more >sklearn.multioutput — ibex latest documentation
Note that y doesn't need to contain all labels in `classes`. sample_weight ... def __init__(self, estimator, n_jobs=1): super(MultiOutputClassifier, self).
Read more >1.12. Multiclass and multilabel algorithms - 《Scikit-learn 0.22 ...
You don't need to use the sklearn.multiclass moduleunless you want ... the multioutputclassification task with different model formulations.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(A) sounds like the best option for now.
Full generality to avoid code duplication would likely be better in the long run but should probably be discussed in more depth by the core team as this will be a reoccuring issue and the solution should be standardized over all of sklearn.
If there are no preferences regarding the options, I will submit a PR with option A) as the approach will be in scope of the issue.