nmf.py 文件源码

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

项目:topic-ensemble 作者: derekgreene 项目源码 文件源码
def rank_terms( self, topic_index, top = -1 ):
        """
        Return the top ranked terms for the specified topic, generated during the last NMF run.
        """
        if self.H is None:
            raise ValueError("No results for previous run available")
        # NB: reverse
        top_indices = np.argsort( self.H[topic_index,:] )[::-1]
        # truncate if necessary
        if top < 1 or top > len(top_indices):
            return top_indices
        return top_indices[0:top]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号