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)
von_mises_fisher_mixture.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录