You are here

protected function CorrelationRecommender::computeSimilarityMemory in Recommender API 6.2

Overrides Recommender::computeSimilarityMemory

File

./Recommender.php, line 486

Class

CorrelationRecommender
The recommender implementation for the classical correlation-coefficient based algorithm

Code

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();
  }
}