pPolis2024-05-27
ここは作業ログ
サムネイル用の要約: 政治家の意見ベクトルをPolis的に可視化した上で党で括った
自民党(右)とれいわ、社民党、共産党(左)
2024-05-27
5段階評価を3段階に丸める方法を2通り試したけど特に面白い結果にはならず…
本質的にクラスターが別れてないから2クラスターに分けた時の境界線が近接している
もちろん初期値の揺れで境界付近は入れ替わる
政党で色を変えてみたけど意味が見出せないな、なんかバグってるのかな...
Explained variance: [0.29123858 0.18823937]
うーん、これ、2次元では分散の半分以上を表現できておらず、極端な回答をしている数人によって張られた空間に射影していることで党の違いがわからなくなってるのかな
えー、そんなことある?
自民と立憲だけにしたデータでクラスタに分けて混ざってるとか
バグなのでは
:----------------------------------
significant comments for group 0
----------------------------------
comment 6 : 他国からの攻撃が予想される場合には敵基地攻撃もためらうべきではない
Count of +1 votes in group: 8.0
Count of 0 votes in group: 51.0
Count of -1 votes in group: 204.0
3.0% / 19.4% / 77.6%
Count of +1 votes outside group: 263.0
Count of 0 votes outside group: 47.0
Count of -1 votes outside group: 13.0
81.4% / 14.6% / 4.0
pvalue: 5.1690034351040005e-82
comment 10 : 首相には靖国神社に参拝してほしい
Count of +1 votes in group: 14.0
Count of 0 votes in group: 48.0
Count of -1 votes in group: 158.0
6.4% / 21.8% / 71.8%
Count of +1 votes outside group: 194.0
Count of 0 votes outside group: 81.0
Count of -1 votes outside group: 9.0
68.3% / 28.5% / 3.2
pvalue: 2.5450099098536335e-56
comment 5 : 日本の防衛力はもっと強化すべきだ
Count of +1 votes in group: 78.0
Count of 0 votes in group: 59.0
Count of -1 votes in group: 125.0
29.8% / 22.5% / 47.7%
Count of +1 votes outside group: 318.0
Count of 0 votes outside group: 8.0
Count of -1 votes outside group: 0.0
97.5% / 2.5% / 0.0
pvalue: 4.270713622876674e-49
comment 11 : 沖縄県の普天間基地の辺野古移設はやむをえない
Count of +1 votes in group: 18.0
Count of 0 votes in group: 44.0
Count of -1 votes in group: 157.0
8.2% / 20.1% / 71.7%
Count of +1 votes outside group: 187.0
Count of 0 votes outside group: 80.0
Count of -1 votes outside group: 19.0
65.4% / 28.0% / 6.6
pvalue: 8.135497457098475e-47
comment 32 : 危機のときのアメリカによる協力を確実にするため、日米安保体制をもっと強化すべきだ / 日本と関係ない戦争に巻き込まれないように、日米安保体制の強化には慎重であるべきだ
Count of +1 votes in group: 79.0
Count of 0 votes in group: 42.0
Count of -1 votes in group: 139.0
30.4% / 16.2% / 53.5%
Count of +1 votes outside group: 242.0
Count of 0 votes outside group: 57.0
Count of -1 votes outside group: 27.0
74.2% / 17.5% / 8.3
pvalue: 1.6118502287656484e-32
total votes in group: 218.0
----------------------------------
significant comments for group 1
----------------------------------
comment 22 : 永住外国人の地方参政権を認めるべきだ
Count of +1 votes in group: 7.0
Count of 0 votes in group: 33.0
Count of -1 votes in group: 247.0
2.4% / 11.5% / 86.1%
Count of +1 votes outside group: 156.0
Count of 0 votes outside group: 43.0
Count of -1 votes outside group: 20.0
71.2% / 19.6% / 9.1
pvalue: 1.0860551845560161e-65
comment 37 : Q5_6
Count of +1 votes in group: 16.0
Count of 0 votes in group: 111.0
Count of -1 votes in group: 199.0
4.9% / 34.0% / 61.0%
Count of +1 votes outside group: 177.0
Count of 0 votes outside group: 59.0
Count of -1 votes outside group: 26.0
67.6% / 22.5% / 9.9
pvalue: 4.6226851092461706e-38
comment 31 : 国会議員の議席や候補者の一定割合を女性に割り当てるクオータ制を導入すべきだ
Count of +1 votes in group: 58.0
Count of 0 votes in group: 112.0
Count of -1 votes in group: 152.0
18.0% / 34.8% / 47.2%
Count of +1 votes outside group: 216.0
Count of 0 votes outside group: 39.0
Count of -1 votes outside group: 7.0
82.4% / 14.9% / 2.7
pvalue: 6.57885322570923e-36
comment 9 : 非核三原則を堅持すべきだ
Count of +1 votes in group: 92.0
Count of 0 votes in group: 100.0
Count of -1 votes in group: 133.0
28.3% / 30.8% / 40.9%
Count of +1 votes outside group: 249.0
Count of 0 votes outside group: 13.0
Count of -1 votes outside group: 2.0
94.3% / 4.9% / 0.8
pvalue: 1.6502232104242013e-34
comment 28 : 夫婦が望む場合には、結婚後も夫婦がそれぞれ結婚前の名字を称することを、法律で認めるべきだ
Count of +1 votes in group: 123.0
Count of 0 votes in group: 68.0
Count of -1 votes in group: 133.0
38.0% / 21.0% / 41.0%
Count of +1 votes outside group: 246.0
Count of 0 votes outside group: 14.0
Count of -1 votes outside group: 3.0
93.5% / 5.3% / 1.1
pvalue: 2.1099888519589346e-33
total votes in group: 256.0
2024-05-28
自民党と共産党から5人ずつ、という削り方をしてみた
ええー、これでも党が別れないの?ほんとに?バグでなく?
:comment 5 : Q4_1日本の防衛力はもっと強化すべきだ
Count of +1 votes in group: 5.0
Count of 0 votes in group: 0.0
Count of -1 votes in group: 0.0
100.0% / 0.0% / 0.0%
Count of +1 votes outside group: 0.0
Count of 0 votes outside group: 0.0
Count of -1 votes outside group: 5.0
0.0% / 0.0% / 100.0
えー、やっぱこれバグってるよな
データポイントと氏名・政党の対応づけが狂ってそう
:labels_=array([0, 1, 1, 1, 1, 0, 0, 0, 1, 0], dtype=int32)
PCA結果の順番が変わってるな
あーー、わかった
データが大きいときに安定性を増すためにまず100件のkMeansを掛けてる、ここで順番がランダムにシャッフルされる
plot_embedding_with_clusters(centers, clusters_K_star)
が
def plot_embedding_with_clusters(embedding_, labels_):
で受けられてるから、このembedding_がmatrixをPCAした結果としてのembeddingとは違うんだ
めでたし!
自民党から30人、共産党から30人とったら綺麗に別れた
再び全データ、名前を出すのを諦めて党で色をつけたもの
少し色に意味ありげな偏りが出たがわかりにくい
Polis的なクラスター境界はあまり意味がない
適切な解釈としては「クラスターは一つしかない」「アルゴリズムが2〜5だから無理やり2個に分けてるだけ」ですね
党ごとに境界線を引いた方が面白そう
れいわと共産党がギュッと小さいクラスタなのに比べてNHK党はバラけててますね。中に2〜3個別のクラスタがありそう。日本維新はコア部分はギュッとしてるけど周辺に散ってる人がいる
自民党(右)とれいわ、社民党、共産党(左)
立憲民主党(左), 公明党, 国民民主党(右下), 日本維新の会(右上)
一度に見れるのは3〜4個が限界ですね
単純なPolisでは面白くなかったけど、これはだいぶ面白い
2024-05-28

Q: PCAの左右と政治思想的な左右が一致している?
A: そうなるような操作はしてない、たまたまだと思う
まあX軸は第一主成分軸だから一番分散の大きい方向になるわけで、それが政治的左右と強い相関があるのはおかしな話ではないかもですね。
1/2の確率で左右は逆になると思う