What exactly does 'use_idf' do when creating a TfidfTransformer in sklearn?
Question: I am using the TfidfTransformer from the sklearn package in Python 2.7.

As I was getting comfortable with the arguments, I became a bit confused about
`use_idf`, as in:

`TfidfVectorizer(use_idf=False).fit_transform(<corpus goes here>)`

What exactly does `use_idf` do when false or true?

Since we are generating a sparse Tfidf matrix, it doesn't make sense to have
an argument to _choose_ a sparse Tfidif matrix; that seems redundant.

[This post](http://stackoverflow.com/questions/22489264/is-a-countvectorizer-
the-same-as-tfidfvectorizer-with-use-idf-false) was interesting but didn't
seem to nail it.

The [documentation](http://scikit-
learn.org/stable/modules/generated/sklearn.feature_extraction.text.TfidfTransformer.html)
says only, `Enable inverse-document-frequency reweighting`, which isn't very
illuminating.

Any comments appreciated.

**EDIT** I think I figured it out. It's real simple:  
Text --> counts  
Counts --> TF, meaning we just have raw counts or Counts --> TFIDF, meaning we
have weighted counts.

What was confusing me was...since they called it `TfidfVectorizer` I didn't
realize that was true only if you chose it to be a TFIDF. You could have also
use it to create just a TF.


Answer: In Term frequency (TF) calculation, all terms are considered equally
important. Even certain terms which have no importance in determining
relevance are treaded in the calculations.

Scaling down the weights for terms with high collection frequency helps the
calculations. Inverse Document Frequency reduces the TF weight of a term by a
factor that grows with its collection frequency. So Document frequency DF of
the term is used to scale its weight.

