zoukankan      html  css  js  c++  java
  • 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的节点的极大子图

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

  • 相关阅读:
    npm 一些常用的命令
    Angular Encapsulation
    隐藏scrollbar
    Vue生命周期详解(1)- 单个组件
    如何自己制作iconfont
    day07-2018-10--25 深浅拷贝
    day06-2018-10--24 小数据池和编码
    day05-2018-10--23 字典
    day04-2018-10--22python基础
    day03-2018-10-19-python基础
  • 原文地址:https://www.cnblogs.com/smartwhite/p/9594991.html
Copyright © 2011-2022 走看看