rapidsai / cuml

cuML - RAPIDS Machine Learning Library
https://docs.rapids.ai/api/cuml/stable/
Apache License 2.0
4.26k stars 535 forks source link

[BUG] Using precomputed KNN with more neighbors than `n_neighbors` drops trustworthiness score for UMAP #5717

Open ravi-bhadauria opened 10 months ago

ravi-bhadauria commented 10 months ago

Describe the bug

cuML UMAP's implementation allows to use precomputed graphs. We can precompute the KNN graph with more neighbors (k_neighbors > n_neighbors), and then choose to experiment with different values of n_neighbors in cuML UMAP while doing grid search or similar. This is something that is advertised in the APIs too. Choosing a value of n_neighbors less than k_neighbors results in a catastrophic drop in the trustworthiness metric.

Steps/Code to reproduce bug A minimal working example with synthetic dataset

import numpy as np
import pandas as pd
from cuml.manifold.umap import UMAP as cuUMAP
from sklearn.datasets import make_blobs
from sklearn.manifold import trustworthiness
from sklearn.neighbors import NearestNeighbors

def fit_umap_and_get_trust(model, data, n_neighbors):
    embedding = model.fit_transform(data)
    trust = trustworthiness(data, embedding, n_neighbors=n_neighbors)
    return trust

def generate_data():
    data, _ = make_blobs(n_samples=2000, n_features=10, centers=5, random_state=0)
    data = data.astype(np.float32)
    return data

def generate_sklearn_knn_graph(data, n_neighbors):
    nn = NearestNeighbors(n_neighbors=n_neighbors, algorithm="brute")
    nn.fit(data)
    # we keep query vector same as data
    adjacency_matrix = nn.kneighbors_graph(data, mode="distance")
    return adjacency_matrix

def main():
    n_neighbors = 8
    data = generate_data()

    # from sklearn
    knn_graph = generate_sklearn_knn_graph(data, n_neighbors)
    model = cuUMAP(n_neighbors=n_neighbors, precomputed_knn=knn_graph, min_dist=0.0)
    sklearn_trust = fit_umap_and_get_trust(model, data, n_neighbors)

    # from sklearn, but neighbors > n_neighbors
    more_neighbors = 1
    knn_graph = generate_sklearn_knn_graph(data, n_neighbors + more_neighbors)
    model = cuUMAP(n_neighbors=n_neighbors, precomputed_knn=knn_graph, min_dist=0.0)
    sklearn_moreNN_trust = fit_umap_and_get_trust(model, data, n_neighbors)

    # from scratch
    model = cuUMAP(n_neighbors=n_neighbors, min_dist=0.0, metric="euclidean")
    nograph_trust = fit_umap_and_get_trust(model, data, n_neighbors)

    print("sklearn trust: ", sklearn_trust)
    print("sklearn trust with more neighbors: ", sklearn_moreNN_trust)
    print("trust without graph: ", nograph_trust)

if __name__ == "__main__":
    main()

Expected behavior As long as NN neighbors > n_neighbors, trustworthiness should be invariant under numerical precision.

Environment details (please complete the following information):

conda list output

# packages in environment at /opt/conda/envs/rapids-23.10:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
absl-py                   2.0.0                    pypi_0    pypi
aiohttp                   3.9.1           py310h2372a71_0    conda-forge
aiosignal                 1.3.1              pyhd8ed1ab_0    conda-forge
anyio                     4.1.0              pyhd8ed1ab_0    conda-forge
aom                       3.7.1                h59595ed_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
argon2-cffi               23.1.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py310h2372a71_4    conda-forge
arrow                     1.3.0              pyhd8ed1ab_0    conda-forge
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
astunparse                1.6.3                    pypi_0    pypi
async-timeout             4.0.3              pyhd8ed1ab_0    conda-forge
attrs                     23.1.0             pyh71513ae_1    conda-forge
aws-c-auth                0.7.4                hc8144f4_1    conda-forge
aws-c-cal                 0.6.2                h09139f6_2    conda-forge
aws-c-common              0.9.3                hd590300_0    conda-forge
aws-c-compression         0.2.17               h184a658_3    conda-forge
aws-c-event-stream        0.3.2                hd6ebb48_1    conda-forge
aws-c-http                0.7.13               hc690213_1    conda-forge
aws-c-io                  0.13.32              h161b759_6    conda-forge
aws-c-mqtt                0.9.6                h32970c0_2    conda-forge
aws-c-s3                  0.3.17               hb5e3142_3    conda-forge
aws-c-sdkutils            0.1.12               h184a658_2    conda-forge
aws-checksums             0.1.17               h184a658_2    conda-forge
aws-crt-cpp               0.23.1               h94c364a_5    conda-forge
aws-sdk-cpp               1.11.156             h6600424_3    conda-forge
beautifulsoup4            4.12.2             pyha770c72_0    conda-forge
black                     23.12.1                  pypi_0    pypi
bleach                    6.1.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.5               h0f2a231_0    conda-forge
bokeh                     3.3.2              pyhd8ed1ab_0    conda-forge
branca                    0.7.0              pyhd8ed1ab_1    conda-forge
brotli                    1.1.0                hd590300_1    conda-forge
brotli-bin                1.1.0                hd590300_1    conda-forge
brotli-python             1.1.0           py310hc6cd4ac_1    conda-forge
brunsli                   0.1                  h9c3ff4c_0    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
c-ares                    1.23.0               hd590300_0    conda-forge
c-blosc2                  2.11.3               hb4ffafa_0    conda-forge
ca-certificates           2023.11.17           hbcca054_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                5.3.2              pyhd8ed1ab_0    conda-forge
cairo                     1.18.0               h3faef2a_0    conda-forge
certifi                   2023.11.17      py310h06a4308_0    anaconda
cffi                      1.16.0          py310h2fee648_0    conda-forge
cfitsio                   4.3.0                hbdc6101_0    conda-forge
charls                    2.4.2                h59595ed_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
click                     8.1.7           unix_pyh707e725_0    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
cligj                     0.7.2              pyhd8ed1ab_1    conda-forge
cloudpickle               3.0.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
colorcet                  3.0.1              pyhd8ed1ab_0    conda-forge
comm                      0.1.4              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.0           py310hd41b1e2_0    conda-forge
cubinlinker               0.3.0           py310hfdf336d_0    rapidsai
cucim                     23.10.00        cuda11_py310_231011_g8dd1727_0    rapidsai
cuda-profiler-api         11.8.86                       0    nvidia
cuda-python               11.8.3          py310h70a93da_0    conda-forge
cuda-version              11.8                 h70ddcb2_2    conda-forge
cudatoolkit               11.8.0              h4ba93d1_12    conda-forge
cudf                      23.10.02        cuda11_py310_231116_gece2b2c524_0    rapidsai
cudf_kafka                23.10.02        cuda11_py310_231116_gece2b2c524_0    rapidsai
cugraph                   23.10.00        cuda11_py310_231011_gc3dc860d_0    rapidsai
cuml                      23.10.00        cuda11_py310_231011_g623996072_0    rapidsai
cuproj                    23.10.00        cuda11_py310_231011_g29cddcdc_0    rapidsai
cupy                      12.3.0          py310hf4db66c_0    conda-forge
cuspatial                 23.10.00        cuda11_py310_231011_g29cddcdc_0    rapidsai
custreamz                 23.10.02        cuda11_py310_231116_gece2b2c524_0    rapidsai
cuxfilter                 23.10.00        cuda11_py310_231011_g6600aff_0    rapidsai
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
cyrus-sasl                2.1.27               h54b06d7_7    conda-forge
cytoolz                   0.12.2          py310h2372a71_1    conda-forge
dask                      2023.9.2           pyhd8ed1ab_0    conda-forge
dask-bigquery             2023.9.0                 pypi_0    pypi
dask-core                 2023.9.2           pyhd8ed1ab_0    conda-forge
dask-cuda                 23.10.00        py310_231011_gdc811d3_0    rapidsai
dask-cudf                 23.10.02        cuda11_py310_231116_gece2b2c524_0    rapidsai
dask-glm                  0.3.2                    pypi_0    pypi
dask-ml                   2023.3.24                pypi_0    pypi
datashader                0.16.0             pyhd8ed1ab_0    conda-forge
dav1d                     1.2.1                hd590300_0    conda-forge
db-dtypes                 1.2.0                    pypi_0    pypi
debugpy                   1.8.0           py310hc6cd4ac_1    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
distributed               2023.9.2           pyhd8ed1ab_0    conda-forge
dlpack                    0.5                  h9c3ff4c_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
exceptiongroup            1.2.0              pyhd8ed1ab_0    conda-forge
executing                 2.0.1              pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hcb278e6_1    conda-forge
faiss-gpu                 1.7.2                    pypi_0    pypi
fastrlock                 0.8.2           py310hc6cd4ac_1    conda-forge
filelock                  3.13.1                   pypi_0    pypi
fiona                     1.9.5           py310h0a1e91f_1    conda-forge
flatbuffers               23.5.26                  pypi_0    pypi
fmt                       9.1.0                h924138e_0    conda-forge
folium                    0.15.1             pyhd8ed1ab_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 h77eed37_1    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.46.0          py310h2372a71_0    conda-forge
fqdn                      1.5.1              pyhd8ed1ab_0    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
freexl                    2.0.0                h743c826_0    conda-forge
frozenlist                1.4.0           py310h2372a71_1    conda-forge
fsspec                    2023.12.1          pyhca7485f_0    conda-forge
gast                      0.5.4                    pypi_0    pypi
gcsfs                     2023.12.2                pypi_0    pypi
gdal                      3.8.0           py310h5c4b078_6    conda-forge
gdk-pixbuf                2.42.10              h829c605_4    conda-forge
geopandas                 0.14.1             pyhd8ed1ab_0    conda-forge
geopandas-base            0.14.1             pyha770c72_0    conda-forge
geos                      3.12.1               h59595ed_0    conda-forge
geotiff                   1.7.1               hf074850_14    conda-forge
gettext                   0.21.1               h27087fc_0    conda-forge
gflags                    2.2.2             he1b5a44_1004    conda-forge
giflib                    5.2.1                h0b41bf4_3    conda-forge
glog                      0.6.0                h6f12383_0    conda-forge
gmock                     1.14.0               ha770c72_1    conda-forge
google-api-core           2.15.0                   pypi_0    pypi
google-auth               2.25.2                   pypi_0    pypi
google-auth-oauthlib      1.2.0                    pypi_0    pypi
google-cloud-bigquery     3.14.0                   pypi_0    pypi
google-cloud-bigquery-storage 2.24.0                   pypi_0    pypi
google-cloud-core         2.4.1                    pypi_0    pypi
google-cloud-storage      2.14.0                   pypi_0    pypi
google-crc32c             1.5.0                    pypi_0    pypi
google-pasta              0.2.0                    pypi_0    pypi
google-resumable-media    2.7.0                    pypi_0    pypi
googleapis-common-protos  1.62.0                   pypi_0    pypi
grpcio                    1.60.0                   pypi_0    pypi
grpcio-status             1.60.0                   pypi_0    pypi
gtest                     1.14.0               h00ab1b0_1    conda-forge
h5py                      3.10.0                   pypi_0    pypi
hdf4                      4.2.15               h2a13503_7    conda-forge
hdf5                      1.14.2          nompi_h4f84152_100    conda-forge
holoviews                 1.18.1             pyhd8ed1ab_0    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.6                pyhd8ed1ab_0    conda-forge
imagecodecs               2023.9.18       py310h496a806_2    conda-forge
imageio                   2.31.5             pyh8c1a49c_0    conda-forge
importlib-metadata        7.0.0              pyha770c72_0    conda-forge
importlib_metadata        7.0.0                hd8ed1ab_0    conda-forge
importlib_resources       6.1.1              pyhd8ed1ab_0    conda-forge
ipykernel                 6.26.0             pyhf8b6a83_0    conda-forge
ipython                   8.18.1             pyh707e725_3    conda-forge
isoduration               20.11.0            pyhd8ed1ab_0    conda-forge
isort                     5.13.2                   pypi_0    pypi
jbig                      2.1               h7f98852_2003    conda-forge
jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
joblib                    1.3.2              pyhd8ed1ab_0    conda-forge
json-c                    0.17                 h7ab15ed_0    conda-forge
jsonpointer               2.4             py310hff52083_3    conda-forge
jsonschema                4.20.0             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.11.2          pyhd8ed1ab_0    conda-forge
jsonschema-with-format-nongpl 4.20.0             pyhd8ed1ab_0    conda-forge
jupyter-server-proxy      4.1.0              pyhd8ed1ab_0    conda-forge
jupyter_client            8.6.0              pyhd8ed1ab_0    conda-forge
jupyter_core              5.5.0           py310hff52083_0    conda-forge
jupyter_events            0.9.0              pyhd8ed1ab_0    conda-forge
jupyter_server            2.12.1             pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.4              pyhd8ed1ab_1    conda-forge
jupyterlab_pygments       0.3.0              pyhd8ed1ab_0    conda-forge
jxrlib                    1.1                  h7f98852_2    conda-forge
kealib                    1.5.2                hcd42e92_1    conda-forge
keras                     2.15.0                   pypi_0    pypi
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.5           py310hd41b1e2_1    conda-forge
krb5                      1.21.2               h659d440_0    conda-forge
lazy_loader               0.3                pyhd8ed1ab_0    conda-forge
lcms2                     2.16                 hb7c19ff_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libabseil                 20230802.1      cxx17_h59595ed_0    conda-forge
libaec                    1.1.2                h59595ed_1    conda-forge
libarchive                3.7.2                h039dbb9_0    conda-forge
libarrow                  12.0.1          h1935d02_14_cpu    conda-forge
libavif16                 1.0.3                hed45d22_0    conda-forge
libblas                   3.9.0           20_linux64_openblas    conda-forge
libboost-headers          1.83.0               ha770c72_0    conda-forge
libbrotlicommon           1.1.0                hd590300_1    conda-forge
libbrotlidec              1.1.0                hd590300_1    conda-forge
libbrotlienc              1.1.0                hd590300_1    conda-forge
libcblas                  3.9.0           20_linux64_openblas    conda-forge
libclang                  16.0.6                   pypi_0    pypi
libcrc32c                 1.1.2                h9c3ff4c_0    conda-forge
libcublas                 11.11.3.6                     0    nvidia
libcublas-dev             11.11.3.6                     0    nvidia
libcucim                  23.10.00        cuda11_231011_g8dd1727_0    rapidsai
libcudf                   23.10.02        cuda11_231116_gece2b2c524_0    rapidsai
libcudf_kafka             23.10.02        cuda11_231116_gece2b2c524_0    rapidsai
libcufft                  10.9.0.58                     0    nvidia
libcufile                 1.4.0.31                      0    nvidia
libcufile-dev             1.4.0.31                      0    nvidia
libcugraph                23.10.00        cuda11_231011_gc3dc860d_0    rapidsai
libcugraph_etl            23.10.00        cuda11_231011_gc3dc860d_0    rapidsai
libcugraphops             23.10.00        cuda11_231011_gca4b54ac_0    nvidia
libcuml                   23.10.00        cuda11_231011_g623996072_0    rapidsai
libcumlprims              23.10.00        cuda11_231011_ge818397_0    nvidia
libcurand                 10.3.0.86                     0    nvidia
libcurand-dev             10.3.0.86                     0    nvidia
libcurl                   8.4.0                hca28451_0    conda-forge
libcusolver               11.4.1.48                     0    nvidia
libcusolver-dev           11.4.1.48                     0    nvidia
libcusparse               11.7.5.86                     0    nvidia
libcusparse-dev           11.7.5.86                     0    nvidia
libcuspatial              23.10.00        cuda11_231011_g29cddcdc_0    rapidsai
libdeflate                1.19                 hd590300_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h807b86a_3    conda-forge
libgdal                   3.8.0                he7dcfe9_6    conda-forge
libgfortran-ng            13.2.0               h69a702a_3    conda-forge
libgfortran5              13.2.0               ha4646dd_3    conda-forge
libglib                   2.78.2               h783c2da_0    conda-forge
libgomp                   13.2.0               h807b86a_3    conda-forge
libgoogle-cloud           2.12.0               h8d7e28b_2    conda-forge
libgrpc                   1.57.0               ha4d0f93_2    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
libjpeg-turbo             3.0.0                hd590300_1    conda-forge
libkml                    1.3.0             h01aab08_1018    conda-forge
libkvikio                 23.10.00        cuda11_231011_g5ea0525_0    rapidsai
liblapack                 3.9.0           20_linux64_openblas    conda-forge
libllvm14                 14.0.6               hcd5def8_4    conda-forge
libnetcdf                 4.9.2           nompi_h80fb2b6_112    conda-forge
libnghttp2                1.58.0               h47da74e_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libntlm                   1.4               h7f98852_1002    conda-forge
libnuma                   2.0.16               h0b41bf4_1    conda-forge
libopenblas               0.3.25          pthreads_h413a1c8_0    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libpq                     16.1                 hfc447b1_0    conda-forge
libprotobuf               4.23.4               hf27288f_6    conda-forge
libraft                   23.10.00        cuda11_231011_gafdddfb3_0    rapidsai
libraft-headers           23.10.00        cuda11_231011_gafdddfb3_0    rapidsai
libraft-headers-only      23.10.00        cuda11_231011_gafdddfb3_0    rapidsai
librdkafka                1.9.2                ha5a0de0_2    conda-forge
librmm                    23.10.00        cuda11_231011_gf8ac6f8e_0    rapidsai
librttopo                 1.1.0               h8917695_15    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libspatialindex           1.9.3                h9c3ff4c_4    conda-forge
libspatialite             5.1.0                h7385560_2    conda-forge
libsqlite                 3.44.2               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_3    conda-forge
libthrift                 0.19.0               hb90f79a_1    conda-forge
libtiff                   4.6.0                ha9c0a0a_2    conda-forge
libutf8proc               2.8.0                h166bdaf_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libuv                     1.46.0               hd590300_0    conda-forge
libwebp                   1.3.2                h658648e_1    conda-forge
libwebp-base              1.3.2                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxgboost                1.7.6           rapidsai_h795055c_2310    rapidsai
libxml2                   2.11.6               h232c23b_0    conda-forge
libzip                    1.10.1               h2629f0a_3    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
libzopfli                 1.0.3                h9c3ff4c_0    conda-forge
linkify-it-py             2.0.0              pyhd8ed1ab_0    conda-forge
llvmlite                  0.40.1          py310h1b8f574_0    conda-forge
locket                    1.0.0              pyhd8ed1ab_0    conda-forge
lz4                       4.3.2           py310h350c4a5_1    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
mapclassify               2.6.1              pyhd8ed1ab_0    conda-forge
markdown                  3.5.1              pyhd8ed1ab_0    conda-forge
markdown-it-py            3.0.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.3           py310h2372a71_1    conda-forge
matplotlib-base           3.8.2           py310h62c0568_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mdit-py-plugins           0.4.0              pyhd8ed1ab_0    conda-forge
mdurl                     0.1.0              pyhd8ed1ab_0    conda-forge
minizip                   4.0.3                h0ab5242_0    conda-forge
mistune                   3.0.2              pyhd8ed1ab_0    conda-forge
ml-dtypes                 0.2.0                    pypi_0    pypi
mpmath                    1.3.0                    pypi_0    pypi
msgpack-python            1.0.7           py310hd41b1e2_0    conda-forge
multidict                 6.0.4           py310h2372a71_1    conda-forge
multipledispatch          0.6.0                      py_0    conda-forge
munch                     4.0.0              pyhd8ed1ab_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mypy-extensions           1.0.0                    pypi_0    pypi
nbclient                  0.8.0              pyhd8ed1ab_0    conda-forge
nbconvert-core            7.12.0             pyhd8ed1ab_0    conda-forge
nbformat                  5.9.2              pyhd8ed1ab_0    conda-forge
nccl                      2.19.4.1             h6103f9b_0    conda-forge
ncurses                   6.4                  h59595ed_2    conda-forge
nest-asyncio              1.5.8              pyhd8ed1ab_0    conda-forge
networkx                  3.2.1              pyhd8ed1ab_0    conda-forge
nodejs                    20.9.0               hb753e55_0    conda-forge
nspr                      4.35                 h27087fc_0    conda-forge
nss                       3.95                 h1d7d5a4_0    conda-forge
numba                     0.57.1          py310h0f6aa51_0    conda-forge
numpy                     1.24.4          py310ha4c1d20_0    conda-forge
nvcomp                    2.6.1                h838ba91_3    conda-forge
nvidia-cublas-cu12        12.1.3.1                 pypi_0    pypi
nvidia-cuda-cupti-cu12    12.1.105                 pypi_0    pypi
nvidia-cuda-nvrtc-cu12    12.1.105                 pypi_0    pypi
nvidia-cuda-runtime-cu12  12.1.105                 pypi_0    pypi
nvidia-cudnn-cu12         8.9.2.26                 pypi_0    pypi
nvidia-cufft-cu12         11.0.2.54                pypi_0    pypi
nvidia-curand-cu12        10.3.2.106               pypi_0    pypi
nvidia-cusolver-cu12      11.4.5.107               pypi_0    pypi
nvidia-cusparse-cu12      12.1.0.106               pypi_0    pypi
nvidia-nccl-cu12          2.18.1                   pypi_0    pypi
nvidia-nvjitlink-cu12     12.3.101                 pypi_0    pypi
nvidia-nvtx-cu12          12.1.105                 pypi_0    pypi
nvtx                      0.2.8           py310h2372a71_1    conda-forge
oauthlib                  3.2.2                    pypi_0    pypi
openjpeg                  2.5.0                h488ebb8_3    conda-forge
openslide                 3.4.1               hcb9e6c7_11    conda-forge
openssl                   3.1.4                hd590300_0    conda-forge
opt-einsum                3.3.0                    pypi_0    pypi
orc                       1.9.0                h52d3b3c_2    conda-forge
overrides                 7.4.0              pyhd8ed1ab_0    conda-forge
packaging                 23.2               pyhd8ed1ab_0    conda-forge
pandas                    1.5.3           py310h9b08913_1    conda-forge
pandas-gbq                0.20.0                   pypi_0    pypi
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
panel                     1.3.4              pyhd8ed1ab_0    conda-forge
param                     2.0.1              pyhca7485f_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
partd                     1.4.1              pyhd8ed1ab_0    conda-forge
pathspec                  0.12.1                   pypi_0    pypi
pcre2                     10.42                hcad00b1_0    conda-forge
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.1.0          py310h01dd4db_0    conda-forge
pip                       23.3.1             pyhd8ed1ab_0    conda-forge
pixman                    0.42.2               h59595ed_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
platformdirs              4.1.0              pyhd8ed1ab_0    conda-forge
poppler                   23.11.0              h590f24d_0    conda-forge
poppler-data              0.4.12               hd8ed1ab_0    conda-forge
postgresql                16.1                 h8972f4a_0    conda-forge
proj                      9.3.0                h1d62c97_2    conda-forge
prometheus_client         0.19.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.41             pyha770c72_0    conda-forge
proto-plus                1.23.0                   pypi_0    pypi
protobuf                  4.23.4          py310h620c231_3    conda-forge
psutil                    5.9.5           py310h2372a71_1    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptxcompiler               0.8.1           py310h70a93da_2    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
py-xgboost                1.7.6           rapidsai_py310h1395376_2310    rapidsai
pyarrow                   12.0.1          py310hf9e7431_14_cpu    conda-forge
pyasn1                    0.5.1                    pypi_0    pypi
pyasn1-modules            0.3.0                    pypi_0    pypi
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyct                      0.5.0              pyhd8ed1ab_0    conda-forge
pydata-google-auth        1.8.2                    pypi_0    pypi
pyee                      8.1.0              pyhd8ed1ab_0    conda-forge
pygments                  2.17.2             pyhd8ed1ab_0    conda-forge
pylibcugraph              23.10.00        cuda11_py310_231011_gc3dc860d_0    rapidsai
pylibraft                 23.10.00        cuda11_py310_231011_gafdddfb3_0    rapidsai
pynndescent               0.5.11                   pypi_0    pypi
pynvml                    11.4.1             pyhd8ed1ab_0    conda-forge
pyparsing                 3.1.1              pyhd8ed1ab_0    conda-forge
pyppeteer                 1.0.2              pyhd8ed1ab_0    conda-forge
pyproj                    3.6.1           py310h32c33b7_4    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.10.13         hd12c33a_0_cpython    conda-forge
python-confluent-kafka    1.9.2           py310h5764c6d_2    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.19.0             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python_abi                3.10                    4_cp310    conda-forge
pytz                      2023.3.post1       pyhd8ed1ab_0    conda-forge
pyviz_comms               3.0.0              pyhd8ed1ab_0    conda-forge
pywavelets                1.4.1           py310h1f7b6fc_1    conda-forge
pyyaml                    6.0.1           py310h2372a71_1    conda-forge
pyzmq                     25.1.2          py310h795f18f_0    conda-forge
raft-dask                 23.10.00        cuda11_py310_231011_gafdddfb3_0    rapidsai
rapids                    23.10.00        cuda11_py310_231011_gd3958fe_0    rapidsai
rapids-xgboost            23.10.00        cuda11_py310_231011_gd3958fe_0    rapidsai
rav1e                     0.6.6                he8a937b_2    conda-forge
rdma-core                 28.9                 h59595ed_1    conda-forge
re2                       2023.03.02           h8c504da_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
referencing               0.32.0             pyhd8ed1ab_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
requests-oauthlib         1.3.1                    pypi_0    pypi
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rich                      13.7.0             pyhd8ed1ab_0    conda-forge
rmm                       23.10.00        cuda11_py310_231011_gf8ac6f8e_0    rapidsai
rpds-py                   0.13.2          py310hcb5633a_0    conda-forge
rsa                       4.9                      pypi_0    pypi
rtree                     1.1.0           py310hbdcdc62_0    conda-forge
s2n                       1.3.54               h06160fa_0    conda-forge
scikit-image              0.21.0          py310hc6cd4ac_0    conda-forge
scikit-learn              1.3.2           py310h1fdf081_2    conda-forge
scipy                     1.11.4          py310hb13e2d6_0    conda-forge
send2trash                1.8.2              pyh41d4057_0    conda-forge
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
shapely                   2.0.2           py310hc3e127f_1    conda-forge
simpervisor               1.0.0              pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.10               h9fff704_0    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
sparse                    0.14.0                   pypi_0    pypi
spdlog                    1.11.0               h9b3ece8_1    conda-forge
sqlite                    3.44.2               h2c6b66d_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
streamz                   0.6.4              pyh6c4a22f_0    conda-forge
svt-av1                   1.7.0                h59595ed_0    conda-forge
sympy                     1.12                     pypi_0    pypi
tblib                     2.0.0              pyhd8ed1ab_0    conda-forge
tensorboard               2.15.1                   pypi_0    pypi
tensorboard-data-server   0.7.2                    pypi_0    pypi
tensorflow                2.15.0.post1             pypi_0    pypi
tensorflow-estimator      2.15.0                   pypi_0    pypi
tensorflow-io-gcs-filesystem 0.35.0                   pypi_0    pypi
termcolor                 2.4.0                    pypi_0    pypi
terminado                 0.18.0             pyh0d859eb_0    conda-forge
threadpoolctl             3.2.0              pyha21a80b_0    conda-forge
tifffile                  2023.9.26          pyhd8ed1ab_0    conda-forge
tiledb                    2.16.3               h8c794c1_3    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tomli                     2.0.1                    pypi_0    pypi
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
torch                     2.1.2                    pypi_0    pypi
tornado                   6.3.3           py310h2372a71_1    conda-forge
tqdm                      4.66.1             pyhd8ed1ab_0    conda-forge
traitlets                 5.14.0             pyhd8ed1ab_0    conda-forge
treelite                  3.9.1           py310h4a6579d_0    conda-forge
treelite-runtime          3.9.1                    pypi_0    pypi
triton                    2.1.0                    pypi_0    pypi
types-python-dateutil     2.8.19.14          pyhd8ed1ab_0    conda-forge
typing-extensions         4.8.0                hd8ed1ab_0    conda-forge
typing_extensions         4.8.0              pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzcode                    2023c                h0b41bf4_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
uc-micro-py               1.0.1              pyhd8ed1ab_0    conda-forge
ucx                       1.14.1               h64cca9d_5    conda-forge
ucx-proc                  1.0.0                       gpu    rapidsai
ucx-py                    0.34.00         py310_231011_g17dceab_0    rapidsai
umap-learn                0.5.5                    pypi_0    pypi
unicodedata2              15.1.0          py310h2372a71_0    conda-forge
uri-template              1.3.0              pyhd8ed1ab_0    conda-forge
uriparser                 0.9.7                hcb278e6_1    conda-forge
urllib3                   1.26.18            pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.12             pyhd8ed1ab_0    conda-forge
webcolors                 1.13               pyhd8ed1ab_0    conda-forge
webencodings              0.5.1              pyhd8ed1ab_2    conda-forge
websocket-client          1.7.0              pyhd8ed1ab_0    conda-forge
websockets                10.4            py310h5764c6d_1    conda-forge
werkzeug                  3.0.1                    pypi_0    pypi
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
wrapt                     1.14.1                   pypi_0    pypi
xarray                    2023.11.0          pyhd8ed1ab_0    conda-forge
xerces-c                  3.2.4                hac6953d_3    conda-forge
xgboost                   1.7.6           rapidsai_py310h1395376_2310    rapidsai
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.1.1                hd590300_0    conda-forge
xorg-libsm                1.2.4                h7391055_0    conda-forge
xorg-libx11               1.8.7                h8ee46fc_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxrender           0.9.11               hd590300_0    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xyzservices               2023.10.1          pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
yarl                      1.9.3           py310h2372a71_0    conda-forge
zeromq                    4.3.5                h59595ed_0    conda-forge
zfp                       1.0.0                h59595ed_4    conda-forge
zict                      3.0.0              pyhd8ed1ab_0    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hd590300_5    conda-forge
zlib-ng                   2.0.7                h0b41bf4_0    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge

Additional context Add any other context about the problem here.

beckernick commented 2 weeks ago

Hi @ravi-bhadauria , thanks for filing this issue. Apologies for the slow response here. I've reproduced this with the current stable v24.10 release, too.

sklearn trust:  0.9595029245283019
sklearn trust with more neighbors:  0.5375494968553459
trust without graph:  0.9602333333333334

cc @dantegd @cjnolet , do you know what might be going on here?