Elffuss BraidHub

kikocis/auto-code-rover public

main · 545 BRawPermalink
1regression in input validation of clustering metrics
2```python
3from sklearn.metrics.cluster import mutual_info_score
4import numpy as np
5
6x = np.random.choice(['a', 'b'], size=20).astype(object)
7mutual_info_score(x, x)
8```
9ValueError: could not convert string to float: 'b'
10
11while
12```python
13x = np.random.choice(['a', 'b'], size=20)
14mutual_info_score(x, x)
15```
16works with a warning?
17
18this worked in 0.21.1 without a warning (as I think it should)
19
20
21Edit by @ogrisel: I removed the `.astype(object)` in the second code snippet.