You are here

function recommender_prediction_classical in Recommender API 6.2

Same name and namespace in other branches
  1. 5 recommender.module \recommender_prediction_classical()
  2. 6 recommender.module \recommender_prediction_classical()

Classical weight-average algorithm to calculate prediction from the similarity matrix, based on average weight. Limitation: we only do database operation for now. no in-memory operation available until future release. Limitation: we only do average weight. regression-based weight maybe included in future release.

Parameters

$app_name the application name that uses this function.:

$table_name the input table name:

$field_mouse the input table field for mouse:

$field_cheese the input table field for cheese:

$field_weight the input table field weight:

$options an array of options: 'missing': how to handle missing data -- 'none' do nothing; 'zero' fill in missing data with zero; 'adjusted' skip mice that don't share cheese in common. 'duplicate': how to handle predictions that already exists in mouse-cheese evaluation. 'preserve' or 'eliminate' 'sensitivity': if similarity is smaller enough to be less than a certain value, we treat it as zero

Return value

null {recommender_prediction} will be filled with prediction data

File

./recommender.module, line 50

Code

function recommender_prediction_classical($app_name, $table_name, $field_mouse, $field_cheese, $field_weight, $options = array()) {
  $recommender = new CorrelationRecommender($app_name, $table_name, $field_mouse, $field_cheese, $field_weight, $options);
  $recommender
    ->computePrediction();
}