ついに本題に入ります. 今回やること 「集合知プログラミング」の3章で使われている,単語の頻度がファイルになっている"blogdata.txt"を使って,階層型クラスタを作成します. 得られる結果はp.47にあるデンドログラムと同じになるはずですが... blogdata.txtの読み込み blogdata.txtはTSV(Tab Separated Values)になっています. このファイルを読み込み,URLをキーにしたHashに格納します. def blog_data_from(file) word_counts = {} lines = File.open(file, 'r').readlines # 先頭行を読んで,単語の配列を作る words = lines.shift.chomp.split("\t") words.delete('Blog') lines.each do |
Pathtraq で Web ページの自動分類を手がけてみて。 Web ページは日々どんどん変わっていくのでフィルタは常に更新されなければいけないんですが、そのためには適切なタイミングに、適切な学習データを用意しなければならない。大変。 メンテナンスフリーが理想ですが、もちろん難しい。 現実的なところとしては「追加学習が必要なことを検知して、適切な学習データの候補を提案してくれる」というものが作りたいなあ……などなど考えているわけです。 そこらへんも含めて、自然言語処理とか機械学習とかそこら辺のお勉強をしてるんですが、実際に手を動かさないとわかんないですよねー。 というわけで、 "Introduction to Information Retrieval" の Chapter 17 "Hierarchical clustering" に沿って、ドキュメントの分類器を作ってみました。 ポイン
逆転検事を先日クリアして、久しぶりに逆転裁判1〜3をやり直そうか迷い中のfujisawaです。シンプルなデータクラスタリングツールを作成しましたので、そのご紹介をさせていただきます。 クラスタリングとは クラスタリングとは、対象のデータ集合中で似ているもの同士をまとめて、いくつかのグループにデータ集合を分割することです。データマイニングや統計分析などでよく利用され、データ集合の傾向を調べたいときなどに役に立ちます。 例えば下図の例ですと、当初はデータがゴチャゴチャと混ざっていてよく分からなかったのですが、クラスタリングすることで、実際は3つのグループのデータのみから構成されていることが分かります。 様々なクラスタリング手法がこれまでに提案されていますが、有名なところではK-means法などが挙げられます。ここでは詳細については触れませんが、クラスタリングについてより詳しく知りたい方は以下の
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く