public abstract class AbstractRecommenderSimilarity extends java.lang.Object implements RecommenderSimilarity
Modifier and Type | Field and Description |
---|---|
protected Configuration |
conf
Configuration
|
protected SymmMatrix |
similarityMatrix
Similarity Matrix
|
Constructor and Description |
---|
AbstractRecommenderSimilarity() |
Modifier and Type | Method and Description |
---|---|
void |
buildSimilarityMatrix(DataModel dataModel)
Build social similarity matrix with trainMatrix in dataModel.
|
void |
buildSocialSimilarityMatrix(DataModel dataModel)
Build social similarity matrix with trainMatrix
and socialMatrix in dataModel.
|
double |
getCorrelation(SparseVector thisVector,
SparseVector thatVector)
Find the common rated items by this user and that user, or the common
users have rated this item or that item.
|
protected abstract double |
getSimilarity(java.util.List<? extends java.lang.Number> thisList,
java.util.List<? extends java.lang.Number> thatList)
Calculate the similarity between thisList and thatList.
|
SymmMatrix |
getSimilarityMatrix()
Return the similarity matrix.
|
protected Configuration conf
protected SymmMatrix similarityMatrix
public void buildSimilarityMatrix(DataModel dataModel)
buildSimilarityMatrix
in interface RecommenderSimilarity
dataModel
- the input data modelpublic void buildSocialSimilarityMatrix(DataModel dataModel)
dataModel
- the input data modelpublic double getCorrelation(SparseVector thisVector, SparseVector thatVector)
thisVector:
- the rated items by this user, or users that have rated this
item .thatVector:
- the rated items by that user, or users that have rated that
item.protected abstract double getSimilarity(java.util.List<? extends java.lang.Number> thisList, java.util.List<? extends java.lang.Number> thatList)
thisList
- this listthatList
- that listpublic SymmMatrix getSimilarityMatrix()
getSimilarityMatrix
in interface RecommenderSimilarity
Copyright © 2017. All Rights Reserved.