sklearn.manifold.trustworthiness

sklearn.manifold.trustworthiness(X, X_embedded, *, n_neighbors=5, metric='euclidean')

[源码]

表示保留本地结构的程度。

可信度在[0,1]之内。定义为:

对于每个样品i,是它在输出空间中的k个最近邻,每个样本j是它在输入空间中的第个最近邻。换言之,输出空间中任何意外的最近邻居都会根据其在输入空间中的排名按比例进行惩罚。

  • “Neighborhood Preservation in Nonlinear Projection Methods: An Experimental Study” J. Venna, S. Kaski
  • “Learning a Parametric Embedding by Preserving Local Structure” L.J.P. van der Maaten
参数 说明
X array, shape (n_samples, n_features) or (n_samples, n_samples)
如果度量是“预先计算的”,则X必须是平方距离矩阵。否则,它每行包含一个样本。
X_embedded array, shape (n_samples, n_components)
在低维空间中嵌入训练数据。
n_neighbors int, optional (default: 5)
将要考虑的邻居数k。
metric string, or callable, optional, default ‘euclidean’
用于计算距原始输入空间的样本之间的成对距离的度量。如果度量是“预先计算的”,则X必须是成对距离或平方距离的矩阵。否则,请参阅sklearn.pairwise.pairwise_distances中的参数度量文档,以获取可用度量的列表。
返回值 说明
trustworthiness float
低维嵌入的可信度。