20newsgroup をダウンロード

http://qwone.com/~jason/20Newsgroups/

20news-bydate.tar.gz
 
- 20 Newsgroups sorted by date; duplicates and some headers removed (18846 documents)


The second ("bydate") is sorted by date into training(60%) and test(40%) sets, does not include cross-posts (duplicates) and does not include newsgroup-identifying headers (Xref, Newsgroups, Path, Followup-To, Date).


このデータには、本にかかれている 379 や metadata は無い。metadata が無いと load_mlcompが使えないようだ。アカウント登録して mlcomp.org からデータ取得することも考えたが、このデータを活かしてすすめてみる。

生データは、train と test に分けて取得できたので、load_filesを使ってみる。
 
#dataset = sklearn.datasets.load_mlcomp("20news-18828", "train",
#                                        mlcomp_root=MLCOMP_DIR,
#                                       categories=groups)

dataset = sklearn.datasets.load_files("/home/pi/bmlswp/data/20news-bydate-train"
,categories=groups)



ここを直して、
 $ python rel_post_mlcomp_01.py 
を動かした。