Repository navigation
[MRG+2] convert to boolean arrays for boolean distances (ex: jaccard) - #6932
Conversation
|
|
||
|
|
||
| def check_pairwise_arrays(X, Y, precomputed=False): | ||
| def check_pairwise_arrays(X, Y, precomputed=False, dtype=None): |
|
Appveyor's failure is unrelated |
| True if X is to be treated as precomputed distances to the samples in | ||
| Y. | ||
|
|
||
| dtype : string, type, list of types or None (default=None) |
There was a problem hiding this comment.
Maybe dtype, list of dtypes rather than type, list of types.
There was a problem hiding this comment.
I took it from check_array, and I tend to prefer it this way.
I feel what you suggest is somehow a recursive definition, and I don't really know if it's less confusing.
There was a problem hiding this comment.
OK fair enough.
For the record, when I hear "type" I am thinking "Python type" so it does sound slightly weird.
|
|
||
| # Test converts list to array-like | ||
| S = func([[1]], metric='precomputed') | ||
| S = func([[1.]], metric='precomputed') |
There was a problem hiding this comment.
Just out of curiosity, was this change necessary?
There was a problem hiding this comment.
If I remember correctly, it's removing a warning in the tests
|
LGTM, I'll wait for the CI statuses and merge this one. |
| # Non-regression test for #4523 | ||
| # 'brute': uses scipy.spatial.distance through pairwise_distances | ||
| # 'ball_tree': uses sklearn.neighbors.dist_metrics | ||
| X = np.random.uniform(size=(6, 5)) |
There was a problem hiding this comment.
Should we use a np.random.RandomState here?
|
For the record, looks like the CircleCI is due do some temporary glitch with |
|
So the AppVeyor build is green on the penultimate commit, I'll merge this one since the last commit is just cosmetics. |
|
Merged, thanks! |
|
Thanks for the review ! |
|
awesome, thanks! |
…#6932) for example jaccard.
…#6932) for example jaccard.
Exact copy of #5460 after git-fu failure.
Closes #4523.