Skip to Content
数据分析之图算法: 基于Spark和Neo4j
book

数据分析之图算法: 基于Spark和Neo4j

by Mark Needham, Amy E. Hodler
September 2020
Intermediate to advanced
213 pages
5h 25m
Chinese
Posts & Telecom Press
Content preview from 数据分析之图算法: 基于Spark和Neo4j
社团发现算法
111
PySpark
中运行这段代码,输出结果如下所示:
label collect_list(id)
180388626432 [jpy-core, jpy-console, jupyter]
223338299392 [matplotlib, spacy]
498216206336 [python-dateutil, numpy, six, pytz]
549755813888 [pandas]
558345748480 [nbconvert, ipykernel, jpy-client]
936302870528 [pyspark]
1279900254208 [py4j]
与连通分量算法相比,本例中库的簇更多。在如何判定簇方面,标签传播算法没有连通分
量算法那么严格。使用标签传播算法,两个相邻(直接连接)的节点可能位于不同的簇
中;然而,在使用连通分量算法时,节点总是与其邻节点位于同一个簇中,这是因为该算
法严格基于关系进行分组。
在本例中,最明显的区别是
Jupyter
的库被划为两个社团,一个包含其核心部分,另一个
为面向客户端的工具。
6.5.4
 使用
Neo4j
实现标签传播算法
下面使用
Neo4j
来尝试同一算法。执行以下查询:
CALL algo.labelPropagation.stream("Library", "DEPENDS_ON",
{ iterations: 10 })
YIELD nodeId, label
RETURN
label,
collect(algo.getNodeById(nodeId).id) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
Presto实战

Presto实战

Matt Fuller, Manfred Moser, Martin Traverso
精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly

Publisher Resources

ISBN: 9787115546678