Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit 3e35999

Browse files
committed
updating results
1 parent 642ec6b commit 3e35999

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

doc/asciidoc/scripts/similarity-pearson.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ MERGE (michael:Person {name: "Michael"})
1818
MERGE (arya:Person {name: "Arya"})
1919
MERGE (karin:Person {name: "Karin"})
2020

21-
MERGE (zhen)-[:RATED {score: 1}]->(home_alone)
21+
MERGE (zhen)-[:RATED {score: 2}]->(home_alone)
2222
MERGE (zhen)-[:RATED {score: 2}]->(good_men)
2323
MERGE (zhen)-[:RATED {score: 3}]->(matrix)
2424
MERGE (zhen)-[:RATED {score: 6}]->(jerry)

doc/asciidoc/similarity-pearson.adoc

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
9697
We'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

Comments
 (0)