-
-
Notifications
You must be signed in to change notification settings - Fork 26k
FIX Correctly sets MDS pairwise attribute #18278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you @thomasjpfan!
@@ -364,7 +367,7 @@ Changelog | |||
- |Enhancement| :class:`multiclass.OneVsOneClassifier` now accepts | |||
the inputs with missing values. Hence, estimators which can handle | |||
missing values (may be a pipeline with imputation step) can be used as | |||
a estimator for multiclass wrappers. | |||
a estimator for multiclass wrappers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch (here and below)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done with a pre-commit hook. (I normally revert these types of commits, but these slipped through).
@@ -386,7 +386,7 @@ def __init__(self, n_components=2, *, metric=True, n_init=4, | |||
|
|||
@property | |||
def _pairwise(self): | |||
return self.kernel == "precomputed" | |||
return self.dissimilarity == "precomputed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that this attribute was not tested because kernel
is not an (hyper)parameter in sklearn.manifold.MDS
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know why this was not tested. There was nothing in the test suite that actually used the _pairwise
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not surprising it wasn't picked up. I wonder how many times MDS has been used in a grid search, let alone with precomputed dissimilarity!
Good catch |
Bug found while working on #18143