EC2でPolis

PolisのDBからデータをエクスポート

py

import pandas as pd
df = pd.read_csv("/Users/nishio/Downloads/polis.csv")
matrix = df.pivot_table(index="pid", columns="tid", values="vote")
print(matrix)

image 75 rows

https://github.com/compdemocracy/analysis/blob/master/notebooks/jupyter/american-assembly-representative-groups-and-comments.ipynb

py

matrix = matrix.dropna(thresh=3)
print(matrix.shape)
# => (59, 8)

論文には7が閾値って書いてあったけど実際は3のようだ

K-3 image

Polis: Scaling Deliberation by Mapping High Dimensional Opinion Spaces

image

image

image

imageimage 0 12 1 36 2 11 うーん、それっぽい絵はできたけど結果が一致しないな

2023-06-22CodeReading

できた

  • image :
comment 7
Count of +1 votes in group:  0.0
Count of 0 votes in group:  2.0
Count of -1 votes in group:  12.0
 
Count of +1 votes outside group:  19.0
Count of 0 votes outside group:  19.0
Count of -1 votes outside group:  7.0
 
pvalue:  5.840739168435112e-05

Polisのバックエンド実装を使わずに、投票データのCSVからPolisのクラスタわけやクラスタごとの「特徴的な回答」を計算できるようになった

2023-06-22 imageimage

image