1. 首页
  2. 数据库
  3. 其它
  4. CountVectorizer参数学习

CountVectorizer参数学习

上传者: 2021-02-01 05:48:07上传 PDF文件 509.96KB 热度 3次
指定vocabulary,此时tokenizer/token_pattern/stop_words/max_df等都无效,即和分词有关的参数都无效。可以看到最终生成的词典只有我们参数中指定的a/他/喜欢 为什么会这样呢?我们去研究一下源代码(sklearn/feature_extraction/text.py): 其中CountVectorizer中的fit_transform的源代码如下所示,需要重点关注的是 self._validate_vocabulary()和self.count_vocab(raw_documents,self.fixed_vocabulary) def fi
下载地址
用户评论