Skip to content

Commit

Permalink
DOC/FIX twenty_newsgroups.rst should use TfidfVectorizer
Browse files Browse the repository at this point in the history
Instead of Vectorizer. Fixes scikit-learn#2173.
  • Loading branch information
har777 authored and larsmans committed Jul 22, 2013
1 parent 9c2ec56 commit bbf74a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Federico Vaggi <vaggi.federico@gmail.com>
Gael Varoquaux <gael.varoquaux@normalesup.org>
Gael Varoquaux <gael.varoquaux@normalesup.org> <varoquau@normalesup.org>
Gilles Louppe <g.louppe@gmail.com> <g.louppe@ulg.ac.be>
Harikrishnan S <hihari777@gmail.com>
Hrishikesh Huilgolkar <hrishikesh911@gmail.com> <hrishikesh@QE-IND-WKS007.(none)>
Immanuel Bayer <mane.desk@gmail.com>
Jake VanderPlas <vanderplas@astro.washington.edu> <jakevdp@yahoo.com>
Expand Down
4 changes: 2 additions & 2 deletions doc/datasets/twenty_newsgroups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ for statistical analysis. This can be achieved with the utilities of the
example that extract `TF-IDF`_ vectors of unigram tokens::


>>> from sklearn.feature_extraction.text import Vectorizer
>>> from sklearn.feature_extraction.text import TfidfVectorizer
>>> documents = [open(f).read() for f in newsgroups_train.filenames]
>>> vectorizer = Vectorizer()
>>> vectorizer = TfidfVectorizer()
>>> vectors = vectorizer.fit_transform(documents)
>>> vectors.shape
(1073, 21108)
Expand Down

0 comments on commit bbf74a9

Please sign in to comment.