networkX.core_number(graph)

今天在学习别人特征工程的时候,看到这样一个函数,max_kcore = pd.DataFrame(list(nx.core_number(graph).items()), columns=["qid", "kcore"]),找了半天找不到nx.core_number()函数返回的是什么。

官方文档是这样介绍的:

Return the core number for each vertex.

A k-core is a maximal subgraph that contains nodes of degree k or more.

The core number of a node is the largest value k of a k-core containing that node.

Parameters:G (NetworkX graph) – A graph or directed graph
Returns:core_number – A dictionary keyed by node to the core number.
Return type:dictionary
Raises:NetworkXError – The k-core is not defined for graphs with self loops or parallel edges.

 

我的理解:

返回值是:core_number   core_number是包含该节点的最大k_core

                  那k_core又是什么呢?k_core是一个包含度大于等于k的节点的极大子图

 

也就是该节点所在的所有极大子图中,最大节点度的最大值。不知道有什么用,也不清楚自己的理解对不对。

 

转载于:https://www.cnblogs.com/smartwhite/p/9594991.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值