Trustworthiness

Trustworthiness#

2026-09-01

1 min read time

Applies to Linux

Trustworthiness is a metric that measures how well a dimensionality reduction technique preserves the local structure of the original, high-dimensional dataset.

#include <cuvs/stats/trustworthiness_score.hpp>

namespace cuvs::stats

Trustworthiness#

double trustworthiness_score(
raft::resources const &handle,
raft::device_matrix_view<const float, int64_t, raft::row_major> X,
raft::device_matrix_view<const float, int64_t, raft::row_major> X_embedded,
int n_neighbors,
cuvs::distance::DistanceType metric = cuvs::distance::DistanceType::L2SqrtUnexpanded,
int batch_size = 512
)#

Compute the trustworthiness score.

Note

The constness of the data in X_embedded is currently casted away and the data is slightly modified.

Parameters:
  • handle – [in] the raft handle

  • X – [in] Data in original dimension

  • X_embedded – [in] Data in target dimension (embedding)

  • n_neighbors – [in] Number of neighbors considered by trustworthiness score

  • metric – [in] Distance metric to use. Euclidean (L2) is used by default

  • batch_size – [in] Batch size

Returns:

Trustworthiness score