本文簡要介紹
networkx.linalg.bethehessianmatrix.bethe_hessian_matrix
的用法。用法:
bethe_hessian_matrix(G, r=None, nodelist=None)
返回 G 的 Bethe Hessian 矩陣。
Bethe Hessian 是由 r 參數化的矩陣族,定義為 H(r) = (r^2 - 1) I - r A + D 其中 A 是鄰接矩陣,D 是節點度的對角矩陣,I是識別矩陣。當正則化器 r = 1 時,它等於圖拉普拉斯算子。
正則化器的默認選擇應該是比率 [2]
- G:圖形
NetworkX 圖
- r:浮點數
正則化參數
- nodelist:列表,可選
根據 nodelist 中的節點對行和列進行排序。如果 nodelist 為 None,則排序由 G.nodes() 生成。
- H:scipy.sparse.csr_matrix
G 的 Bethe Hessian 矩陣,參數為 r。
參數:
返回:
參考:
- 1
A. Saade, F. Krzakala and L. Zdeborová “Spectral clustering of graphs with the bethe hessian”, Advances in Neural Information Processing Systems. 2014.
- 2
C. M. Lee, E. Levina “Estimating the number of communities in networks by spectral methods” arXiv:1507.00827, 2015.
例子:
>>> k = [3, 2, 2, 1, 0] >>> G = nx.havel_hakimi_graph(k) >>> H = nx.modularity_matrix(G)
相關用法
- Python NetworkX bellman_ford_path用法及代碼示例
- Python NetworkX bellman_ford_predecessor_and_distance用法及代碼示例
- Python NetworkX bellman_ford_path_length用法及代碼示例
- Python NetworkX binomial_graph用法及代碼示例
- Python NetworkX boykov_kolmogorov用法及代碼示例
- Python NetworkX bfs_edges用法及代碼示例
- Python NetworkX biconnected_component_edges用法及代碼示例
- Python NetworkX bfs_beam_edges用法及代碼示例
- Python NetworkX biconnected_components用法及代碼示例
- Python NetworkX bfs_predecessors用法及代碼示例
- Python NetworkX bfs_successors用法及代碼示例
- Python NetworkX bridges用法及代碼示例
- Python NetworkX bfs_tree用法及代碼示例
- Python NetworkX bridge_components用法及代碼示例
- Python NetworkX bipartite_layout用法及代碼示例
- Python NetworkX bidirectional_dijkstra用法及代碼示例
- Python NetworkX negative_edge_cycle用法及代碼示例
- Python NetworkX voronoi_cells用法及代碼示例
- Python NetworkX numerical_edge_match用法及代碼示例
- Python NetworkX inverse_line_graph用法及代碼示例
- Python NetworkX LFR_benchmark_graph用法及代碼示例
- Python NetworkX write_graph6用法及代碼示例
- Python NetworkX DiGraph.__contains__用法及代碼示例
- Python NetworkX average_degree_connectivity用法及代碼示例
- Python NetworkX eulerian_circuit用法及代碼示例
注:本文由純淨天空篩選整理自networkx.org大神的英文原創作品 networkx.linalg.bethehessianmatrix.bethe_hessian_matrix。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。