首页 > Web开发 > 详细

networkX.core_number(graph)

时间:2018-09-05 23:21:30      阅读:204      评论:0      收藏:0      [点我收藏+]

今天在学习别人特征工程的时候,看到这样一个函数,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的节点的极大子图

 

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

 

networkX.core_number(graph)

原文:https://www.cnblogs.com/smartwhite/p/9594991.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!