docs/algo/sona/motif.md
Motif范式特征是针对有向图中的三元组从点边位置和方向上呈现的不同形式构造的特征。如下右图所示,我们为二元/三元组一共定义了33种范式特征。在计算时,会输出每个节点对应的33种范式结构出现的次数,如 12 1:1, 2:11, 3:4 表示id为12的节点共存在1/2/3三种范式结构,每种结构分别出现了1/11/4 次。
对于边带权的有向图,范式结构出现的次数会有一个权重的加权,目前定义了两种加权方式:强度Intensity和一致性Coherence,强度表示范式中所有边权重的几何平均值,一致性表示范式中所有边权重的几何平均值与算数平均值的比值,具体计算方式如下图。在目前版本中,我们只实现了基于强度Intensity的计算。
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 "hindex angel" \
--jars $SONA_SPARK_JARS \
--driver-memory 5g \
--num-executors 1 \
--executor-cores 4 \
--executor-memory 10g \
--class org.apache.spark.angel.examples.graph.MotifExample \
../lib/spark-on-angel-examples-3.3.0.jar
input:$input output:$output sep:tab storageLevel:MEMORY_ONLY useBalancePartition:true \
partitionNum:4 psPartitionNum:1