algorithms.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:scikit-cmeans 作者: bm424 项目源码 文件源码
def distances(self, x):
        """Calculates the distance between data x and the centers.

        The distance, by default, is calculated according to `metric`, but this
        method should be overridden by subclasses if required.

        Parameters
        ----------
        x : :obj:`np.ndarray`
            (n_samples, n_features)
            The original data.

        Returns
        -------
        :obj:`np.ndarray`
            (n_samples, n_clusters)
            Each entry (i, j) is the distance between sample i and cluster
            center j.

        """
        return cdist(x, self.centers, metric=self.metric)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号