Fix supported types of KNN predict_proba
@@ -366,6 +366,8 @@ class NeighborsBase(BaseNeighborsBase):
class KNeighborsMixin(BaseKNeighborsMixin):
def kneighbors(self, X=None, n_neighbors=None, return_distance=True):
daal_model = getattr(self, '_daal_model', None)
+ if X is not None:
+ X = check_array(X, accept_sparse='csr', dtype=[np.float64, np.float32])
x = self._fit_X if X is None else X
try:
fptype = getFPType(x)
