dodiscover.ci.monte_carlo.generate_knn_in_subspace#

dodiscover.ci.monte_carlo.generate_knn_in_subspace(z_arr, method='knn', k=1, n_jobs=None)[source]#

Generate kNN in subspace.

Parameters:
z_arrarray_like of shape (n_samples, n_features_z)

The covariate space.

methodstr, optional

Method to use, by default ‘knn’. Can be (‘knn’, ‘kdtree’).

kint, optional

The number of k-nearest neighbors to query, by default 1.

n_jobsint,

The number of CPUs to use for joblib. By default, None.

Returns:
indicesarray_like of shape (n_samples, k)

The indices of the k-nearest-neighbors for each sample.