(a, b)
| 88 | const dot12 = vectors[1].reduce((s, x, i) => s + x * vectors[2][i], 0); |
| 89 | const norm = (v) => Math.sqrt(v.reduce((s, x) => s + x * x, 0)); |
| 90 | const cosine = (a, b) => |
| 91 | a.reduce((s, x, i) => s + x * b[i], 0) / (norm(a) * norm(b)); |
| 92 | |
| 93 | console.log("\n Cosine similarities:"); |
| 94 | console.log( |
no test coverage detected