protected function computeSimilarityMemory() { // data is already loaded by $this->loadDirectMatrix() watchdog('recommender', "Computing similarity scores in memory. Could be CPU resource intensive. Please be patient"); $this->similarityMatrix = Matrix::correlation($this->directMatrix); // cleanaup $this->saveSimilarityMatrix($this->lowerbound); $this->purgeOutdatedRecords('similarity'); if ($this->sim_pred == FALSE) { $this->cleanupMemory(); } }
protected function computeSimilarity() { // regardless of the type of preferenceMatrix, similarityMatrix will be a "SparseMatrix". $this->similarityMatrix = Matrix::correlation($this->preferenceMatrix); }