LoginSignup
2
2

More than 5 years have passed since last update.

Rで可視化。Pixivタグ検索結果からデンドログラムを出力

Last updated at Posted at 2014-03-30

出力イメージ

now loading...

概要

Pixivタグ間の関係を調べる為にクラスター分析を行い、その結果をデンドログラムで可視化する。

処理

01.Pixivタグ検索結果からタグ間のクロス集計データを作る。(Ruby)

-> Rubyで前処理。Pixivのタグ検索結果からクロス集計データを作る

OUTPUT.csv
艦隊これくしょん,百合,艦これ,加賀,赤城,赤賀,大北,天龍,大井,鈴熊,北上,龍田,天龍田,女性提督
艦隊これくしょん,294,283,227,70,61,52,24,21,20,19,19,18,15,15
百合,283,288,223,69,60,52,24,20,20,19,19,17,14,15
艦これ,227,223,233,57,49,42,16,21,13,17,13,18,15,12
加賀,70,69,57,70,58,39,0,1,0,2,0,1,1,1
赤城,61,60,49,58,61,39,0,0,0,0,0,0,1,0
赤賀,52,52,42,39,39,53,1,0,0,1,0,0,1,0
大北,24,24,16,0,0,1,24,1,19,1,19,1,0,0
天龍,21,20,21,1,0,0,1,21,1,0,1,18,10,1
大井,20,20,13,0,0,0,19,1,20,1,19,1,0,0
鈴熊,19,19,17,2,0,1,1,0,1,20,1,0,0,0
北上,19,19,13,0,0,0,19,1,19,1,19,1,0,0
龍田,18,17,18,1,0,0,1,18,1,0,1,18,10,1
天龍田,15,14,15,1,1,1,0,10,0,0,0,10,15,1
女性提督,15,15,12,1,0,0,0,1,0,0,0,1,1,15

02.Rでクラスター分析を実行し、デンドログラムで可視化する。(R)

pxcluster.r
dt <- read.csv("OUTPUT.csv")
dt.dist <- dist(dt)
dt.hc <- hclust(dt.dist)
plot(dt.hc)
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2