@@ -77,22 +77,23 @@ include::scripts/similarity-pearson.cypher[tag=stream]
7777[opts="header"]
7878|===
7979| `from` | `to` | `similarity`
80- | "Arya " | "Zhen" | 1.0
81- | "Arya " | "Praveena" | 1.0
82- | "Arya" | "Karin" | 0.9773555548504417
83- | "Zhen" | "Praveena" | 0.9561828874675149
84- | "Karin" | "Zhen " | 0.0
85- | "Karin" | "Praveena" | 0.0
86- | "Praveena" | "Michael" | -0.7857142857142859
87- | "Zhen" | "Michael" | -0.8660254037844386
88- | "Arya " | "Michael " | -1.0
89- | "Karin " | "Michael " | -1.0
80+ | "Zhen " | "Praveena" | 0.8865926413116155
81+ | "Zhen " | "Karin" | 0.8320502943378437
82+ | "Arya" | "Karin" | 0.8194651785206903
83+ | "Zhen" | "Arya" | 0.4839533792540704
84+ | "Praveena" | "Karin " | 0.4472135954999579
85+ | "Praveena" | "Arya" | 0.09262336892949784
86+ | "Praveena" | "Michael" | -0.788492846568306
87+ | "Zhen" | "Michael" | -0.9091365607973364
88+ | "Michael " | "Arya " | -0.9551953674747637
89+ | "Michael " | "Karin " | -0.9863939238321437
9090
9191|===
9292// end::stream[]
9393
94- Zhen and Arya, and Praveena and Arya are the most similar with a score of 1.0 - the maximum score.
95- We also have 5 pairs of users who are not similar at all.
94+ Zhen and Praveena are the most similar with a score of 0.88.
95+ The maximum score is 1.0
96+ We also have 4 pairs of users who are not similar at all.
9697We'd probably want to filter those out, which we can do by passing in the `similarityCutoff` parameter.
9798
9899.The following will return a stream of node pairs that have a similarity of at least 0.1, along with their Pearson similarities:
@@ -106,10 +107,11 @@ include::scripts/similarity-pearson.cypher[tag=stream-similarity-cutoff]
106107[opts="header"]
107108|===
108109| `from` | `to` | `similarity`
109- | "Arya" | "Zhen" | 1.0
110- | "Arya" | "Praveena" | 1.0
111- | "Arya" | "Karin" | 0.9773555548504417
112- | "Zhen" | "Praveena" | 0.9561828874675149
110+ | "Zhen" | "Praveena" | 0.8865926413116155
111+ | "Zhen" | "Karin" | 0.8320502943378437
112+ | "Arya" | "Karin" | 0.8194651785206903
113+ | "Zhen" | "Arya" | 0.4839533792540704
114+ | "Praveena" | "Karin" | 0.4472135954999579
113115|===
114116// end::stream-similarity-cutoff[]
115117
@@ -128,16 +130,16 @@ include::scripts/similarity-pearson.cypher[tag=stream-topk]
128130[opts="header",cols="1,1,1"]
129131|===
130132| `from` | `to` | `similarity`
131- | "Arya " | "Zhen " | 1.0
132- | "Zhen" | "Arya" | 1.0
133- | "Praveena" | "Arya" | 1.0
134- | "Karin " | "Arya" | 0.9773555548504417
133+ | "Zhen " | "Praveena " | 0.8865926413116155
134+ | "Praveena" | "Zhen" | 0.8865926413116155
135+ | "Karin" | "Zhen" | 0.8320502943378437
136+ | "Arya " | "Karin" | 0.8194651785206903
135137
136138|===
137139// end::stream-topk[]
138140
139- These results will not be symmetrical.
140- For example, the person most similar to Karin is Arya , but the person most similar to Arya is Zhen.
141+ These results will not necessarily be symmetrical.
142+ For example, the person most similar to Arya is Karin , but the person most similar to Karin is Zhen.
141143
142144.Parameters
143145[opts="header",cols="1,1,1,1,4"]
0 commit comments