def _distance_matrix(self, X1, X2):
"""
This private method returns the following matrix:
:math:`\\boldsymbol{D_{ij}} = \\varphi(\\| \\boldsymbol{x_i} -
\\boldsymbol{y_j} \\|)`
:param numpy.ndarray X1: the vector x in the formula above.
:param numpy.ndarray X2: the vector y in the formula above.
:return: matrix: the matrix D.
:rtype: numpy.ndarray
"""
matrix = cdist(
X1, X2, lambda x, y: self.basis(x-y, self.parameters.radius)
)
return matrix
评论列表
文章目录