เมตริกระดับโหนด

การวิเคราะห์ข้อมูลโซเชียลมีเดียด้วย Python

Alex Hanna

Computational Social Scientist

Centrality: ความสำคัญของโหนด

  • Centrality
    • วัดความสำคัญของโหนดในเครือข่าย
    • มีแนวคิดเรื่อง "ความสำคัญ" หลายรูปแบบ
การวิเคราะห์ข้อมูลโซเชียลมีเดียด้วย Python

Degree centrality

Degree

  • จำนวนเอดจ์ที่เชื่อมต่อกับโหนด
  • Directed network มี degree 2 ประเภท
    • In-degree - เอดจ์ที่วิ่งเข้าสู่โหนด
    • Out-degree - เอดจ์ที่วิ่งออกจากโหนด
nx.in_degree_centrality(T)
nx.out_degree_centrality(T)

In-degree centrality

การวิเคราะห์ข้อมูลโซเชียลมีเดียด้วย Python

Betweenness centrality

  • จำนวน shortest path ระหว่างสองโหนดที่ผ่านโหนดนี้
  • วัดความสำคัญในฐานะตัวกลางของเครือข่าย
nx.betweenness_centrality(T)

Betweenness centrality

การวิเคราะห์ข้อมูลโซเชียลมีเดียด้วย Python

แสดงค่า centrality สูงสุด

bc = nx.betweenness_centrality(T)

betweenness = pd.DataFrame( list(bc.items()), columns = ['Name', 'Cent'])
print(betweenness.sort_values( 'Cent', ascending = False).head())
    Name  Centrality
0      0    0.232540
23    23    0.158514
7      7    0.158514
15    15    0.158514
21    21    0.157588

Betweenness centrality

การวิเคราะห์ข้อมูลโซเชียลมีเดียด้วย Python

Centrality ในเครือข่ายรูปแบบต่างๆ

ตาราง Centrality 2x3

การวิเคราะห์ข้อมูลโซเชียลมีเดียด้วย Python

อัตราส่วน

degree_rt = pd.DataFrame(list(G_rt.in_degree()), 
                         columns = ['screen_name', 'degree'])
degree_reply = pd.DataFrame(list(G_reply.in_degree()),
                            columns = ['screen_name', 'degree'])

ratio = degree_rt.merge(degree_reply, on = 'screen_name', suffixes = ('_rt', '_reply'))
ratio['ratio'] = ratio['degree_reply'] / ratio['degree_rt']
การวิเคราะห์ข้อมูลโซเชียลมีเดียด้วย Python

มาฝึกกันเถอะ!

การวิเคราะห์ข้อมูลโซเชียลมีเดียด้วย Python

Preparing Video For Download...