我正在学习Gremlin和JanusGraph,并希望计算与此Cypher/Neo4j example类似的Jaccard相似度。
我有带有属性的案例ID。我想将一个给定案例与具有给定属性A的所有其他案例进行比较。
下面是一些伪代码:
Case1 = [A, B, C, D]
Case2 = [A, B, D, E]
Case3 = [A, C, D]
Case4 = [A, D, E, F]
Case5 = [B, D]
Case6 = [C, D, E]
CaseNew = [A, D, E]
for all cases with property [A]
compute Jaccard Similarity between CaseNew and CaseN
#this would give the Jaccard Similarity for
#CaseNew - Case1
#CaseNew - Case2
#CaseNew - Case3
#CaseNew - Case4