jcolibri.extensions.recommendation.collaborative
Class PearsonMatrixCaseBase

java.lang.Object
  extended by jcolibri.extensions.recommendation.collaborative.MatrixCaseBase
      extended by jcolibri.extensions.recommendation.collaborative.PearsonMatrixCaseBase
All Implemented Interfaces:
CBRCaseBase

public class PearsonMatrixCaseBase
extends MatrixCaseBase

Extension of the MatrixCaseBase that computes similarities among neighbors using the Pearson Correlation.
It uses a minCorrelateItems Factor to weight similar neighbors that have few common correlate items.

Version:
1.0
Author:
Juan A. Recio-Garcia, Developed at University College Cork (Ireland) in collaboration with Derek Bridge.
See Also:
MoviesRecommender

Nested Class Summary
 
Nested classes/interfaces inherited from class jcolibri.extensions.recommendation.collaborative.MatrixCaseBase
MatrixCaseBase.RatingTuple, MatrixCaseBase.SimilarTuple
 
Constructor Summary
PearsonMatrixCaseBase(Attribute value, int minCorrelateItemsFactor)
          Constructor
 
Method Summary
protected  void computeSimilarities()
          Computes the similarity of neighbors (each neighbor is defined by the description)
 double getAverage(int id)
          returns the ratings average for a given user
 double getSimil(java.lang.Integer id1, java.lang.Integer id2)
          Returns the similarity of two neighbors.
 java.util.Collection<MatrixCaseBase.SimilarTuple> getSimilar(java.lang.Integer id)
          Returns the list of similar neighbors for a given one
 
Methods inherited from class jcolibri.extensions.recommendation.collaborative.MatrixCaseBase
close, forgetCases, getCases, getCases, getDescription, getDescriptions, getRatingTuples, getSolution, getSolutions, init, learnCases
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PearsonMatrixCaseBase

public PearsonMatrixCaseBase(Attribute value,
                             int minCorrelateItemsFactor)
Constructor

Parameters:
value - is the attribute of the result part of the case that contains the rating
minCorrelateItemsFactor - factor that decreases the similarity between users who have fewer than this number of co-rated items
Method Detail

computeSimilarities

protected void computeSimilarities()
Description copied from class: MatrixCaseBase
Computes the similarity of neighbors (each neighbor is defined by the description)

Specified by:
computeSimilarities in class MatrixCaseBase

getSimilar

public java.util.Collection<MatrixCaseBase.SimilarTuple> getSimilar(java.lang.Integer id)
Description copied from class: MatrixCaseBase
Returns the list of similar neighbors for a given one

Specified by:
getSimilar in class MatrixCaseBase
Parameters:
id - of the neighbor
Returns:
a list of SimilarTuple (other neighbor id + similarity value).

getSimil

public double getSimil(java.lang.Integer id1,
                       java.lang.Integer id2)
Description copied from class: MatrixCaseBase
Returns the similarity of two neighbors.

Specified by:
getSimil in class MatrixCaseBase
Parameters:
id1 - of the first neighbor
id2 - of the second neighbor.
Returns:
a double between 0 and 1

getAverage

public double getAverage(int id)
returns the ratings average for a given user

Parameters:
id - is the user
Returns:
the ratings average

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es