@@ -119,12 +119,12 @@ reference the filenames are also available::
119119
120120Let's print the first lines of the first loaded file::
121121
122- >>> print ("\n".join(twenty_train.data[0].split("\n")[:3]))
122+ >>> print("\n".join(twenty_train.data[0].split("\n")[:3]))
123123 From: [email protected] (Michael Collier) 124124 Subject: Converting images to HP LaserJet III?
125125 Nntp-Posting-Host: hampton
126126
127- >>> print (twenty_train.target_names[twenty_train.target[0]])
127+ >>> print(twenty_train.target_names[twenty_train.target[0]])
128128 comp.graphics
129129
130130Supervised learning algorithms will require a category label for each
@@ -143,7 +143,7 @@ integer id of each sample is stored in the ``target`` attribute::
143143It is possible to get back the category names as follows::
144144
145145 >>> for t in twenty_train.target[:10]:
146- ... print (twenty_train.target_names[t])
146+ ... print(twenty_train.target_names[t])
147147 ...
148148 comp.graphics
149149 comp.graphics
@@ -303,7 +303,7 @@ on the transformers, since they have already been fit to the training set::
303303 >>> predicted = clf.predict(X_new_tfidf)
304304
305305 >>> for doc, category in zip(docs_new, predicted):
306- ... print ('%r => %s' % (doc, twenty_train.target_names[category]))
306+ ... print('%r => %s' % (doc, twenty_train.target_names[category]))
307307 ...
308308 'God is love' => soc.religion.christian
309309 'OpenGL on the GPU is fast' => comp.graphics
@@ -364,7 +364,7 @@ classifier object into our pipeline::
364364analysis of the results::
365365
366366 >>> from sklearn import metrics
367- >>> print (metrics.classification_report(twenty_test.target, predicted,
367+ >>> print(metrics.classification_report(twenty_test.target, predicted,
368368 ... target_names=twenty_test.target_names))
369369 ... # doctest: +NORMALIZE_WHITESPACE
370370 precision recall f1-score support
@@ -454,7 +454,7 @@ we can do::
454454
455455 >>> best_parameters, score, _ = max(gs_clf.grid_scores_, key=lambda x: x[1])
456456 >>> for param_name in sorted(parameters.keys()):
457- ... print ("%s: %r" % (param_name, best_parameters[param_name]))
457+ ... print("%s: %r" % (param_name, best_parameters[param_name]))
458458 ...
459459 clf__alpha: 0.001
460460 tfidf__use_idf: True
0 commit comments