edu.qut.cs.rcmd.core.common.neighborhood
Class CommonUserNeighborhood
java.lang.Object
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
.
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 modeldataModel
- 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 modelsamplingRate
- 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 modeldataModel
- Data modelsamplingRate
- 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
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.