You are here

protected function Recommender::prepareData in Recommender API 6.2

After calling this function, data would be ready to process. Could be: 1) if it's in database, then $->tableName, $this->$field* would store the correct info. 2) if it's in memory, then $this->directMatrix will be the matrix

Parameters

$performance could be 'memory' or 'database':

$missing could be 'none' or 'zero'.:

Return value

unknown_type

5 calls to Recommender::prepareData()
CooccurrenceRecommender::computeSimilarity in ./Recommender.php
CorrelationRecommender::computePrediction in ./Recommender.php
Recommender::computePrediction in ./Recommender.php
Recommender::computeSimilarity in ./Recommender.php
SlopeOneRecommender::computePrediction in ./Recommender.php

File

./Recommender.php, line 102

Class

Recommender
The super class for all other Recommender algorithms.

Code

protected function prepareData($performance, $missing = 'none') {
  if ($performance == 'database') {
    $this
      ->processTable();

    // if $tableName is SQL, then process it.
    if ($missing == 'zero') {

      // don't think expanding the data is useful for database.
      // code could be found in recommender.module v.1.10 _recommender_expand_sparse_data()
    }
  }
  else {
    if ($performance == 'memory') {
      $sparse = $missing == 'zero' ? FALSE : TRUE;
      $this
        ->loadDirectMatrix($sparse);
    }
  }
}