Skip to content

Commit 02b07a9

Browse files
committed
Pushing the docs to dev/ for branch: master, commit ec5a9fcf4f4e3cc4748f7145a58292be1e662edb
1 parent bab641a commit 02b07a9

File tree

1,171 files changed

+4157
-3991
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,171 files changed

+4157
-3991
lines changed
Binary file not shown.

dev/_downloads/388641d133587cc11aa26f2dbef4b950/plot_document_classification_20newsgroups.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
The dataset used in this example is the 20 newsgroups dataset. It will be
1212
automatically downloaded, then cached.
1313
14-
The bar plot indicates the accuracy, training time (normalized) and test time
15-
(normalized) of each classifier.
16-
1714
"""
1815

1916
# Author: Peter Prettenhofer <[email protected]>
@@ -51,8 +48,6 @@
5148
logging.basicConfig(level=logging.INFO,
5249
format='%(asctime)s %(levelname)s %(message)s')
5350

54-
55-
# parse commandline arguments
5651
op = OptionParser()
5752
op.add_option("--report",
5853
action="store_true", dest="print_report",
@@ -98,8 +93,12 @@ def is_interactive():
9893
print()
9994

10095

101-
# #############################################################################
102-
# Load some categories from the training set
96+
##############################################################################
97+
# Load data from the training set
98+
# ------------------------------------
99+
# Let's load data from the newsgroups dataset which comprises around 18000
100+
# newsgroups posts on 20 topics split in two subsets: one for training (or
101+
# development) and the other one for testing (or for performance evaluation).
103102
if opts.all_categories:
104103
categories = None
105104
else:
@@ -200,8 +199,11 @@ def trim(s):
200199
return s if len(s) <= 80 else s[:77] + "..."
201200

202201

203-
# #############################################################################
202+
##############################################################################
204203
# Benchmark classifiers
204+
# ------------------------------------
205+
# We train and test the datasets with 15 different classification models
206+
# and get performance results for each model.
205207
def benchmark(clf):
206208
print('_' * 80)
207209
print("Training: ")
@@ -294,8 +296,12 @@ def benchmark(clf):
294296
tol=1e-3))),
295297
('classification', LinearSVC(penalty="l2"))])))
296298

297-
# make some plots
298299

300+
##############################################################################
301+
# Add plots
302+
# ------------------------------------
303+
# The bar plot indicates the accuracy, training time (normalized) and test time
304+
# (normalized) of each classifier.
299305
indices = np.arange(len(results))
300306

301307
results = [[x[i] for x in results] for i in range(4)]

dev/_downloads/3b31bf37034a6ece04667cd422e5ff79/plot_document_classification_20newsgroups.ipynb

Lines changed: 56 additions & 2 deletions
Large diffs are not rendered by default.
Binary file not shown.

dev/_downloads/scikit-learn-docs.pdf

21.6 KB
Binary file not shown.

dev/_images/iris.png

0 Bytes
82 Bytes
82 Bytes
114 Bytes
114 Bytes

0 commit comments

Comments
 (0)