分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

networkX.core_number(graph)

发布时间:2023-09-06 02:07责任编辑:董明明关键词:暂无标签

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

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved