用法:
cugraph.dask.link_analysis.pagerank.pagerank(input_graph, alpha=0.85, personalization=None, max_iter=100, tol=1e-05, nstart=None)
使用多個 GPU 查找圖中每個頂點的 PageRank 值。 cuGraph 使用冪方法計算 Pagerank 的近似值。輸入圖必須包含邊列表作為 dask-cudf 數據幀,每個 GPU 一個分區。
- input_graph:cugraph.DiGraph
cuGraph 圖說明符,應包含連接信息作為 dask cudf 邊列表數據幀(該算法不使用邊權重)。當前不支持無向圖。
- alpha:浮點數,可選(默認=0.85)
阻尼因子 alpha 表示跟隨出邊的概率,標準值為 0.85。因此,1.0-alpha 是“teleport” 到隨機頂點的概率。 Alpha 應大於 0.0 並嚴格低於 1.0。
- personalization:cudf.Dataframe,可選(默認=無)
包含個性化信息的 GPU 數據幀。目前不支持。
- 個性化[‘vertex’]:cudf.Series
用於個性化的圖形頂點子集
- 個性化[‘values’]:cudf.Series
頂點的個性化值
- max_iter:int,可選(默認=100)
返回答案之前的最大迭代次數。如果此值小於或等於 0,cuGraph 將使用默認值,即 30。
- tol:浮點數,可選(默認=1.0e-5)
設置容差的近似值,這個參數應該是一個小的幅度值。容差越低,近似值越好。如果該值為 0.0f,cuGraph 將使用默認值 1.0E-5。由於數值舍入,容差設置太小會導致不收斂。通常 0.01 和 0.00001 之間的值是可以接受的。
- nstart:不支持
pagerank 的初步猜測
- PageRank:dask_cudf.DataFrame
GPU 數據幀包含兩個大小為 V 的dask_cudf.Series:頂點標識符和相應的 PageRank 值。
- ddf[‘vertex’]:dask_cudf.係列
包含頂點標識符
- ddf[‘pagerank’]:dask_cudf.係列
包含 PageRank 分數
參數:
返回:
例子:
>>> # import cugraph.dask as dcg >>> # ... Init a DASK Cluster >>> # see https://docs.rapids.ai/api/cugraph/stable/dask-cugraph.html >>> # Download dataset from https://github.com/rapidsai/cugraph/datasets/.. >>> # chunksize = dcg.get_chunksize(datasets_path / "karate.csv") >>> # ddf = dask_cudf.read_csv(input_data_path, chunksize=chunksize) >>> # dg = cugraph.Graph(directed=True) >>> # dg.from_dask_cudf_edgelist(ddf, source='src', destination='dst', >>> # edge_attr='value') >>> # pr = dcg.pagerank(dg)
相關用法
- Python cugraph.dask.community.louvain.louvain用法及代碼示例
- Python cugraph.dask.common.read_utils.get_chunksize用法及代碼示例
- Python cugraph.dask.traversal.bfs.bfs用法及代碼示例
- Python cugraph.dask.centrality.katz_centrality.katz_centrality用法及代碼示例
- Python cugraph.dask.traversal.sssp.sssp用法及代碼示例
- Python cugraph.community.spectral_clustering.spectralBalancedCutClustering用法及代碼示例
- Python cugraph.link_prediction.jaccard.jaccard用法及代碼示例
- Python cugraph.link_prediction.wjaccard.jaccard_w用法及代碼示例
- Python cugraph.community.ecg.ecg用法及代碼示例
- Python cugraph.Graph.from_cudf_adjlist用法及代碼示例
- Python cugraph.community.louvain.louvain用法及代碼示例
- Python cugraph.tree.minimum_spanning_tree.maximum_spanning_tree用法及代碼示例
- Python cugraph.centrality.betweenness_centrality.betweenness_centrality用法及代碼示例
- Python cugraph.link_analysis.pagerank.pagerank用法及代碼示例
- Python cugraph.traversal.bfs.bfs用法及代碼示例
- Python cugraph.community.egonet.batched_ego_graphs用法及代碼示例
- Python cugraph.tree.minimum_spanning_tree.minimum_spanning_tree用法及代碼示例
- Python cugraph.Graph.from_cudf_edgelist用法及代碼示例
- Python cugraph.centrality.betweenness_centrality.edge_betweenness_centrality用法及代碼示例
- Python cugraph.link_prediction.woverlap.overlap_w用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cugraph.dask.link_analysis.pagerank.pagerank。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。