question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MultiOutputClassifier should have `decision_function`

See original GitHub issue

Describe 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
YannDubscommented, Dec 8, 2021

(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.

0reactions
chrittercommented, Dec 8, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found