You are here

public function ItemBasedRecommender::initialize in Recommender API 7.6

Initialize the recommender settings from $params. No complexity should be introduced here.

Parameters

$params:

Return value

null

Overrides CFRecommender::initialize

1 call to ItemBasedRecommender::initialize()
ItemBasedBooleanRecommender::initialize in classes/Recommender.php
Initialize the recommender settings from $params. No complexity should be introduced here.
1 method overrides ItemBasedRecommender::initialize()
ItemBasedBooleanRecommender::initialize in classes/Recommender.php
Initialize the recommender settings from $params. No complexity should be introduced here.

File

classes/Recommender.php, line 218

Class

ItemBasedRecommender

Code

public function initialize($params) {

  // do a simple trick of inverse item/user fields.
  parent::initialize($params);
  $user_field = $this->structure['preference']['user field'];
  $item_field = $this->structure['preference']['item field'];
  $this->structure['preference']['user field'] = $item_field;
  $this->structure['preference']['item field'] = $user_field;
}