docs/algo/sona/LPA_sona.md
LPA(label propagation algorithm)算法是一种基于图的半监督学习方法,在社区发现领域有广泛的应用。
LPA算法利用已标记节点的标签信息去预测未标记节点的标签信息。我们基于Spark On Angel实现了大规模网络上的标签传播算法。 其中ps维护节点的最新的节点的标签值,Spark端维护网络的邻接表。每轮根据节点邻居标签对节点进行更新。在执行一定轮数之后终止。
tab, 空格, 逗号等DISK_ONLY/MEMORY_ONLY/MEMORY_AND_DISKinput=hdfs://my-hdfs/data
output=hdfs://my-hdfs/output
source ./spark-on-angel-env.sh
$SPARK_HOME/bin/spark-submit \
--master yarn-cluster\
--conf spark.ps.instances=1 \
--conf spark.ps.cores=1 \
--conf spark.ps.jars=$SONA_ANGEL_JARS \
--conf spark.ps.memory=10g \
--name "lpa angel" \
--jars $SONA_SPARK_JARS \
--driver-memory 5g \
--num-executors 1 \
--executor-cores 4 \
--executor-memory 10g \
--class org.apache.spark.angel.examples.graph.LPAExample \
../lib/spark-on-angel-examples-3.1.0.jar
input:$input output:$output sep:tab storageLevel:MEMORY_ONLY useBalancePartition:true \
partitionNum:4 psPartitionNum:1 maxIter:100 needReplicaEdge:true