von_mises_fisher_mixture.py 文件源码

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

项目:spherecluster 作者: clara-labs 项目源码 文件源码
def transform(self, X, y=None):
        """Transform X to a cluster-distance space.
        In the new space, each dimension is the cosine distance to the cluster
        centers.  Note that even if X is sparse, the array returned by
        `transform` will typically be dense.

        Parameters
        ----------
        X : {array-like, sparse matrix}, shape = [n_samples, n_features]
            New data to transform.

        Returns
        -------
        X_new : array, shape [n_samples, k]
            X transformed in the new space.
        """
        if self.normalize:
            X = normalize(X)

        check_is_fitted(self, 'cluster_centers_')
        X = self._check_test_data(X)
        return self._transform(X)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号