Commit Graph

82 Commits

Author SHA1 Message Date
Rob Speer abddaa8c69 ENH Add filters on newsgroup text
It is easy to overfit on the 20newsgroups dataset, by letting
classifiers learn from metadata that commonly appears in newsgroup
texts, but would be useless for identifying topics outside of this set
of newsgroups in 1993.

For example, many classifiers will tell you that three of the most
informative features are "nntp", "posting", and "host", because the
NNTP-Posting-Host header appears with different frequency in different
groups.

The fetch_20newsgroups function now allows you to ask for any of the
following kinds of text to be removed:

- Newsgroup headers (which contain lots of NNTP metadata that can
  identify the group)
- Signature blocks (which often contain multiple terms that uniquely
  identify the person posting, which in turn identifies the group)
- Quote blocks (which contain people's e-mail addresses and large
  amounts of text from another post in the same newsgroup)

The 20newsgroups classification example takes the "--filtered" flag,
which will remove all of these. This noticeably decreases the accuracy
of all classifiers, leaving room for a better method to improve the
accuracy.
2013-07-22 13:53:02 +02:00
Rob Speer f1f0a1a203 FIX Minor stuff in document_classification_20newsgroups output
- The size of the test set should be labeled (test set), not (training
  set).
- The generated figure is so tall that it doesn't fit on a Mac laptop
  screen; shrink it by 20%.
2013-07-22 13:53:02 +02:00
Robert Layton dacfd8bd5d DOC: Replaced all BSD style licenses with "BSD 3 clause"
Replaced all BSD style licenses with "BSD 3 clause"
Not checked yet!

Removed duplicate "3 clause, 3 clause"

Removed trailing period if exists

Fixed some missed licences, still about 50 to do, but those can be automated

Think I got the last of them.

Apparently me and sed have different ideas of regex.

Found a few more
2013-04-30 08:34:46 +02:00
Jaques Grobler 3b8d2ecee9 fix for iris dataset 2013-03-18 13:52:20 +01:00
Lars Buitinck 541987802f P3K range vs. xrange 2013-02-14 02:05:35 +01:00
Lars Buitinck 837093df7f P3K: use print as a function in the examples
Also corrected some typos, including two people misspelling their own names :)
2013-02-01 15:04:42 +01:00
Andreas Mueller bf1aac67f4 COSMIT pep8 2013-01-20 14:55:15 +01:00
Olivier Grisel 0c2a87ffa1 ENH: measure feature extraction speed in document classification example 2013-01-20 13:05:28 +01:00
Olivier Grisel d3a0aaa7a9 Initial work on hashing vectorizer 2013-01-20 13:04:46 +01:00
Andreas Mueller 38b455d541 Cosmit pep8 2012-12-25 13:16:05 +01:00
Olivier Grisel 9701ce7fac remove the random projection option from the 20 newsgroups example
- the output will be dense and the models expect sparse input.
- the hyperparameters would need to be re-tuned for the new
  dimensionality. f1 scores without re-tuning is misleading

Better have dedicated examples for random projections.
2012-12-21 14:34:19 +01:00
Olivier Grisel 8eb855446a make it possible to use random projection on the 20 newsgroups classification example 2012-12-21 14:34:18 +01:00
Mathieu Blondel 8788713c3b Update document classification example. 2012-11-05 22:38:11 +09:00
Mathieu Blondel 8c9cc855d6 Can afford better precision in news20 example. 2012-09-29 02:16:05 +09:00
Mathieu Blondel 107abb6f3e Add lsqr solver. 2012-09-29 02:16:05 +09:00
Lars Buitinck 9d5936ee87 Revert "BUG rm RidgeClassifier from 20newsgroups"
This reverts commit 179eabcba4.
2012-09-19 14:08:52 +02:00
Lars Buitinck 179eabcba4 BUG rm RidgeClassifier from 20newsgroups
Current implementation has quadratic space complexity in terms of X.
Should use scipy.sparse.linalg.lsqr for linear space version (@mblondel).
2012-09-15 16:05:27 +02:00
Lars Buitinck 16a5719558 BUG fix broken top-10 features printing in text clf example 2012-09-11 10:41:00 +02:00
Mathieu Blondel e55e2c568d Normalize training and test times. 2012-08-21 15:17:44 +09:00
Mathieu Blondel 8043efbc06 Add all_categories option. 2012-08-21 14:42:25 +09:00
Gael Varoquaux 833fc05e09 COSMIT simplify a bit examples 2012-05-05 21:57:05 +02:00
Alexandre Gramfort 15455263b7 API : change back default C to 1. explicitely and epsilon 0.1 2012-05-05 21:57:04 +02:00
Lars Buitinck 56b3167771 COSMIT pep8 document classification example 2012-04-24 21:53:00 +02:00
Lars Buitinck 91a7b65557 DOC small fixes to NearestCentroid classifier
Point out connection to Rocchio classifier from NLP/IR.
2012-03-27 18:48:38 +02:00
Robert Layton d213168bef metric fixed in tests 2012-03-27 19:48:45 +11:00
Robert Layton f5de79a91c Removed unneeded numpy.array call in test
Added NearestCentroid to 20 newsgroups example
2012-03-27 19:40:50 +11:00
Olivier Grisel c0541fa03b Renamed Vectorizer to TfidfVectorizer + deprecation warning 2012-03-07 06:48:56 -08:00
Olivier Grisel b7a77e8962 demonstrate stop words in example (+ slighly faster convergence) 2012-03-05 10:58:11 +01:00
Olivier Grisel 38d4332293 factorize feature names array 2012-03-03 19:19:33 +01:00
Olivier Grisel 631705c49f merge master 2012-03-03 19:02:45 +01:00
Andreas Mueller 0187838ebe DOC document classification plot 2012-03-03 17:52:11 +01:00
Olivier Grisel 11d6116de5 missing C re-scaling in example 2012-03-03 17:26:56 +01:00
Olivier Grisel 882dd38faf missing C re-scaling in example 2012-03-03 17:26:20 +01:00
Olivier Grisel a510d17a05 Flatten the feature extraction API 2012-03-03 17:20:32 +01:00
Lars Buitinck 5e92beb694 ENH sublinear tf scaling in TfidfTransformer 2012-02-04 16:51:40 +01:00
Mathieu Blondel bb1be4e0ef Add Perceptron to document classification example. 2012-01-29 02:42:01 +09:00
Lars Buitinck d5f02dae3d Merge branch 'master' into merge-linearsvcs
Conflicts:
	examples/document_classification_20newsgroups.py
2012-01-17 09:21:33 +01:00
Lars Buitinck 9b0fbab0d1 ENH merge dense/sparse LinearSVC, part 3: deprecate sparse.LinearSVC 2012-01-16 18:27:14 +01:00
Mathieu Blondel 36c2dcb804 Updat examples. 2012-01-14 22:40:29 +09:00
draxus e5628f79c6 peping8 examples 2011-12-19 18:16:51 +01:00
Lars Buitinck 7375d50de1 DOC typo 2011-11-07 22:01:31 +01:00
Jake Vanderplas bc02942bc3 Nearest Neighbors examples & documentation 2011-09-11 10:45:34 -07:00
Mathieu Blondel b93cde81bd Documenting a secret feature and fixing bugs in the process. 2011-09-06 19:12:00 +09:00
Fabian Pedregosa ddf4b72109 Move project directory from scikits.learn to sklearn 2011-09-02 12:06:57 +02:00
Fabian Pedregosa 68f27e3790 Revert "Move project directory from scikits.learn to sklearn"
This reverts commit fd0d3b879d.
2011-09-02 12:03:18 +02:00
Fabian Pedregosa fd0d3b879d Move project directory from scikits.learn to sklearn 2011-09-02 11:38:24 +02:00
Gael varoquaux 5d1b1e9836 API+ENH: load data by default in mlcomp and 20news
Conflicts:

	scikits/learn/datasets/__init__.py
2011-07-30 14:51:06 +02:00
Lars Buitinck 130b84d724 Rename f_chi2 to chi2 2011-07-23 00:30:21 +02:00
Lars Buitinck 486044bc8c Demo chi2 feature selection on document classification
Also update the example script to use optparse.
2011-07-23 00:30:21 +02:00
Lars Buitinck bd72672cc4 ENH show top 10 terms per category in document classifier example 2011-07-15 14:26:40 +02:00