edu.qut.cs.rcmd.core.common.neighborhood
Class CommonUserNeighborhood

java.lang.Object
  extended by edu.qut.cs.rcmd.core.common.neighborhood.CommonUserNeighborhood
All Implemented Interfaces:
org.apache.mahout.cf.taste.common.Refreshable, org.apache.mahout.cf.taste.neighborhood.UserNeighborhood

public final class CommonUserNeighborhood
extends Object
implements org.apache.mahout.cf.taste.neighborhood.UserNeighborhood

Computes a neighborhood consisting of all users with commonly rated items to the target user. Similarity is defined by the given UserSimilarity.


Constructor Summary
CommonUserNeighborhood(org.apache.mahout.cf.taste.model.DataModel dataModel)
           
CommonUserNeighborhood(org.apache.mahout.cf.taste.model.DataModel dataModel, double samplingRate)
           
CommonUserNeighborhood(int n, org.apache.mahout.cf.taste.model.DataModel dataModel)
           
CommonUserNeighborhood(int n, org.apache.mahout.cf.taste.model.DataModel dataModel, double samplingRate)
           
 
Method Summary
 long[] getUserNeighborhood(long userID)
           
 void refresh(Collection<org.apache.mahout.cf.taste.common.Refreshable> alreadyRefreshed)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommonUserNeighborhood

public CommonUserNeighborhood(org.apache.mahout.cf.taste.model.DataModel dataModel)
                       throws org.apache.mahout.cf.taste.common.TasteException
Parameters:
dataModel - Data model
Throws:
org.apache.mahout.cf.taste.common.TasteException - If dataModel is null

CommonUserNeighborhood

public CommonUserNeighborhood(int n,
                              org.apache.mahout.cf.taste.model.DataModel dataModel)
                       throws org.apache.mahout.cf.taste.common.TasteException
Parameters:
n - Neighborhood size; capped at the number of users in the data model
dataModel - Data model
Throws:
org.apache.mahout.cf.taste.common.TasteException - If dataModel is null

CommonUserNeighborhood

public CommonUserNeighborhood(org.apache.mahout.cf.taste.model.DataModel dataModel,
                              double samplingRate)
                       throws org.apache.mahout.cf.taste.common.TasteException
Parameters:
dataModel - Data model
samplingRate - Percentage of users to consider when building neighborhood -- decrease to trade quality for performance
Throws:
org.apache.mahout.cf.taste.common.TasteException - If dataModel is null

CommonUserNeighborhood

public CommonUserNeighborhood(int n,
                              org.apache.mahout.cf.taste.model.DataModel dataModel,
                              double samplingRate)
                       throws org.apache.mahout.cf.taste.common.TasteException
Parameters:
n - Neighborhood size; capped at the number of users in the data model
dataModel - Data model
samplingRate - Percentage of users to consider when building neighborhood -- decrease to trade quality for performance
Throws:
org.apache.mahout.cf.taste.common.TasteException - If dataModel is null
Method Detail

getUserNeighborhood

public long[] getUserNeighborhood(long userID)
                           throws org.apache.mahout.cf.taste.common.TasteException
Specified by:
getUserNeighborhood in interface org.apache.mahout.cf.taste.neighborhood.UserNeighborhood
Throws:
org.apache.mahout.cf.taste.common.TasteException

refresh

public void refresh(Collection<org.apache.mahout.cf.taste.common.Refreshable> alreadyRefreshed)
Specified by:
refresh in interface org.apache.mahout.cf.taste.common.Refreshable

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.