'Predict the target for the provided data
Parameters
X : array-like, shape (n_query, n_features),                 or (n_query, n_indexed) if metric == \'precomputed\'
Test samples.
Returns
y : array of int, shape = [n_samples] or [n_samples, n_outputs]
Target values'

def predict(self, X):

    X = check_array(X, accept_sparse='csr')
    (neigh_dist, neigh_ind) = self.radius_neighbors(X)
    weights = _get_weights(neigh_dist, self.weights)
    _y = self._y
    if (_y.ndim == 1):
        _y = _y.reshape(((-1), 1))
    if (weights is None):
        y_pred = np.array([np.mean(_y[ind, :], axis=0) for ind in neigh_ind])
    else:
        y_pred = np.array([np.average(_y[ind, :], axis=0, weights=weights[i]) for (i, ind) in enumerate(neigh_ind)])
    if (self._y.ndim == 1):
        y_pred = y_pred.ravel()
    return y_pred
