Is a countvectorizer the same as tfidfvectorizer with use_idf=false?

前端 未结 2 1464
臣服心动
臣服心动 2021-02-02 00:50

As the title states: Is a countvectorizer the same as tfidfvectorizer with use_idf=false ? If not why not ?

So does this also mean that adding

2条回答
  •  甜味超标
    2021-02-02 01:01

    As larsmans said, TfidfVectorizer(use_idf=False, normalize=None, ...) is supposed to behave the same as CountVectorizer.

    In the current version (0.14.1), there's a bug where TfidfVectorizer(binary=True, ...) silently leaves binary=False, which can throw you off during a grid search for the best parameters. (CountVectorizer, in contrast, sets the binary flag correctly.) This appears to be fixed in future (post-0.14.1) versions.

提交回复
热议问题