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.

Be more tolerant in check_array for CalibratedClassifierCV

See original GitHub issue

For our package http://github.com/metric-learn/metric-learn, the function CalibratedClassifierCV is very convenient for Weakly Supervised Learners, as it can make PairsClassifier estimators return a probability for a pair of points to be labeled as similar or dissimilar, when those return a decision function.

However, we currently cannot use it because our inputs can be 3D (example: pairs=[[[2.3, 5.4], [4.4, 5.6]], [[7.5, 1.2], [4.4, 5.6]]]), and CalibratedClassifierCV uses check_array with default parameters that does not allow 3D inputs.

However, other meta-estimators like GridSearchCV do not call check_array, so we can use them easily in metric-learn.

Is the check_array in CalibratedClassifierCV really useful or could we do without it ? If we could, I’d be happy to provide a PR to do so

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
connorbrintoncommented, Apr 1, 2019

I think this issue is also related to #8710, which has to do with CalibratedClassifierCV’s input validation in a pipeline context

0reactions
belletcommented, Apr 4, 2019

So would the addition of allow_nd=True in the check_array be the way to go then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

sklearn.calibration.CalibratedClassifierCV
The calibration is based on the decision_function method of the estimator if it exists, else on predict_proba. Read more in the User Guide....
Read more >
Scikit correct way to calibrate classifiers with ... - Cross Validated
The way to ensure the data is 'disjoint' is cross validation: for any given fold, CCCV will split X and y into your...
Read more >
What's the right way to insert a CalibratedClassifierCV in ...
I am trying to add a calibration step in a sklearn pipeline to obtain a calibrated classifier and thus have more trustworthy ...
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