networkx.algorithms.link_analysis.hits_alg.hits_numpy
的用法。用法:
hits_numpy(G, normalized=True)
返回節點的 HITS 集線器和權限值。
自 2.6 版起已棄用:hits_numpy 已棄用,將在 networkx 3.0 中刪除。
HITS 算法計算一個節點的兩個數字。當局根據傳入鏈接估計節點值。 Hubs 根據傳出鏈接估計節點值。
- G:圖形
NetworkX 圖
- normalized:布爾(默認=真)
通過所有值的總和對結果進行歸一化。
- (hubs,authorities):字典的二元組
由節點鍵入的兩個字典,包含中心值和權限值。
參數:
返回:
注意:
特征向量計算使用 NumPy 的 LAPACK 接口。
HITS 算法是為有向圖設計的,但該算法不檢查輸入圖是否有向,並將在無向圖上執行。
參考:
- 1
A. Langville and C. Meyer, “A survey of eigenvector methods of web information retrieval.” http://citeseer.ist.psu.edu/713792.html
- 2
Jon Kleinberg, Authoritative sources in a hyperlinked environment Journal of the ACM 46 (5): 604-32, 1999. doi:10.1145/324133.324140. http://www.cs.cornell.edu/home/kleinber/auth.pdf.
例子:
>>> G = nx.path_graph(4)
hubs
和authorities
由分別對應於hubs_matrix和authority_matrix的最大特征值的特征向量給出。hubs
和authority
矩陣是從鄰接矩陣計算的:>>> adj_ary = nx.to_numpy_array(G) >>> hubs_matrix = adj_ary @ adj_ary.T >>> authority_matrix = adj_ary.T @ adj_ary
hits_numpy
將各個矩陣的最大特征值對應的特征向量映射到G
中的節點:>>> hubs, authority = nx.hits_numpy(G)
相關用法
- Python NetworkX hits_scipy用法及代碼示例
- Python NetworkX hits用法及代碼示例
- Python NetworkX harmonic_function用法及代碼示例
- Python NetworkX has_bridges用法及代碼示例
- 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用法及代碼示例
- Python NetworkX single_source_dijkstra_path_length用法及代碼示例
- Python NetworkX from_dict_of_dicts用法及代碼示例
- Python NetworkX weisfeiler_lehman_subgraph_hashes用法及代碼示例
- Python NetworkX transitive_closure_dag用法及代碼示例
- Python NetworkX intersection用法及代碼示例
- Python NetworkX MultiGraph.size用法及代碼示例
- Python NetworkX Graph.size用法及代碼示例
- Python NetworkX from_scipy_sparse_array用法及代碼示例
- Python NetworkX local_and_global_consistency用法及代碼示例
- Python NetworkX number_of_selfloops用法及代碼示例
- Python NetworkX single_source_bellman_ford用法及代碼示例
- Python NetworkX all_simple_paths用法及代碼示例
注:本文由純淨天空篩選整理自networkx.org大神的英文原創作品 networkx.algorithms.link_analysis.hits_alg.hits_numpy。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。