Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: Remove superfluous assignment in tutorial. issue #8285 #8314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/tutorial/text_analytics/working_with_text_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ The names ``vect``, ``tfidf`` and ``clf`` (classifier) are arbitrary.
We shall see their use in the section on grid search, below.
We can now train the model with a single command::

>>> text_clf = text_clf.fit(twenty_train.data, twenty_train.target)
>>> text_clf.fit(twenty_train.data, twenty_train.target) # doctest: +ELLIPSIS
Pipeline(...)


Evaluation of the performance on the test set
Expand Down Expand Up @@ -353,7 +354,8 @@ classifier object into our pipeline::
... ('clf', SGDClassifier(loss='hinge', penalty='l2',
... alpha=1e-3, n_iter=5, random_state=42)),
... ])
>>> _ = text_clf.fit(twenty_train.data, twenty_train.target)
>>> text_clf.fit(twenty_train.data, twenty_train.target) # doctest: +ELLIPSIS
Pipeline(...)
>>> predicted = text_clf.predict(docs_test)
>>> np.mean(predicted == twenty_test.target) # doctest: +ELLIPSIS
0.912...
Expand Down