| 1 | Missing parameter validation in Neighbors estimator for float n_neighbors |
| 2 | ```python |
| 3 | from sklearn.neighbors import NearestNeighbors |
| 4 | from sklearn.datasets import make_blobs |
| 5 | X, y = make_blobs() |
| 6 | neighbors = NearestNeighbors(n_neighbors=3.) |
| 7 | neighbors.fit(X) |
| 8 | neighbors.kneighbors(X) |
| 9 | ``` |
| 10 | ``` |
| 11 | ~/checkout/scikit-learn/sklearn/neighbors/binary_tree.pxi in sklearn.neighbors.kd_tree.NeighborsHeap.__init__() |
| 12 | |
| 13 | TypeError: 'float' object cannot be interpreted as an integer |
| 14 | ``` |
| 15 | This should be caught earlier and a more helpful error message should be raised (or we could be lenient and cast to integer, but I think a better error might be better). |
| 16 | |
| 17 | We need to make sure that |
| 18 | ```python |
| 19 | neighbors.kneighbors(X, n_neighbors=3.) |
| 20 | ``` |
| 21 | also works. |