我是靠谱客的博主 勤恳菠萝,这篇文章主要介绍sklearn计算idf值公式,现在分享给大家,希望可以做个参考。

        if self.use_idf:
            n_samples, n_features = X.shape
            df = _document_frequency(X)
            df = df.astype(dtype, **`_astype_copy_false`(df))

            # perform idf smoothing if required
            df += int(self.smooth_idf)
            n_samples += int(self.smooth_idf)

            # log+1 instead of log makes sure terms with zero idf don't get
            # suppressed entirely.
            idf = np.log(n_samples / df) + 1

最后

以上就是勤恳菠萝最近收集整理的关于sklearn计算idf值公式的全部内容,更多相关sklearn计算idf值公式内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(108)

评论列表共有 0 条评论

立即
投稿
返回
顶部