网络中心性度量

用 R 分析社交媒体数据

Sowmya Vivek

Data Science Coach

课程概览

  • 网络中心性度量的概念
  • 度中心性与中介中心性
  • 识别网络关键角色及其在推广活动中的作用
用 R 分析社交媒体数据

网络中心性度量

  • 顶点影响力由边数和其位置决定
  • 网络中心性衡量顶点在网络中的重要性
  • 中心性度量为每个顶点赋予数值
  • 该数值衡量其对其他顶点的影响
用 R 分析社交媒体数据

度中心性

  • 最简单的顶点影响力度量
  • 表示顶点的边/连接数
  • 在有向网络中,顶点有出度与入度得分
用 R 分析社交媒体数据

出度

出度

用 R 分析社交媒体数据

入度

入度

用 R 分析社交媒体数据

用户的度中心性

library(igraph)
# Calculate out-degree
out_deg <- degree(nw_rtweet, 
                  "OutfitAww", 
                   mode = c("out"))
out_deg
OutfitAww 
    20
library(igraph)
# Calculate in degree
in_deg <- degree(nw_rtweet, 
                 "OutfitAww", 
                  mode = c("in"))
in_deg
OutfitAww 
   23
用 R 分析社交媒体数据

转推次数最多的用户

# Calculate the out-degree scores
out_degree <- degree(nw_rtweet, mode = c("out"))
# Sort the users in descending order of out-degree scores
out_degree_sort <- sort(out_degree, decreasing = TRUE)
用 R 分析社交媒体数据

转推次数最多的用户

# View the top 3 users
out_degree_sort[1:3]
VanesEtim   RedNileShop     w3daily 
  209           147            62
用 R 分析社交媒体数据

被转推最多的用户

# Calculate the in-degree scores
in_degree <- degree(nw_rtweet, mode = c("in"))
# Sort the users in descending order of in-degree scores
in_degree_sort <- sort(in_degree, decreasing = TRUE)
用 R 分析社交媒体数据

被转推最多的用户

# View the top 3 users
in_degree_sort[1:3]
XyC_129    SocialBflyMag      jisoupy 
  171           167             142
用 R 分析社交媒体数据

中介中心性

  • 描述节点彼此间"居中"的程度
  • 反映用户在信息通过网络时的桥接作用
  • 中介中心性更高的节点对网络更有控制力

中介中心性

用 R 分析社交媒体数据

识别中介中心性高的用户

# Calculate the betweenness scores of the network
betwn_nw <- betweenness(nw_rtweet, directed = TRUE)
# Sort the users in descending order of betweenness scores
betwn_nw_sort <- betwn_nw %>%
                   sort(decreasing = TRUE) %>%
                   round()
用 R 分析社交媒体数据

识别中介中心性高的用户

# View the top 3 users
betwn_nw_sort[1:3]
GuruOfficial   Home_and_Loving    SimplyTasheena 
   65                54                40
用 R 分析社交媒体数据

让我们练习吧!

用 R 分析社交媒体数据

Preparing Video For Download...