Cosine-Similarity Installation composer require algenza/cosine-similarity How to use? use Algenza\Cosinesimilarity\Cosine; $vectorA = [ 'type' => 3, 'code' => 5, 'run' => 2 ]; $vectorB = [ 'type' => 3, 'code' => 5, 'run' => 2 ]; $similarity = Cosine::similarity($vectorA, $vectorB); Lisence MIT