public class MahoutUserNeighborhood extends Object implements org.apache.mahout.cf.taste.neighborhood.UserNeighborhood
RecommenderMahoutCFUser
. There
are two algorithms to select: NearesN (the n most similar users) and Threshold (users with a
similarity value mayor than a threshold).Constructor and Description |
---|
MahoutUserNeighborhood(String type,
int n,
double threshold,
org.apache.mahout.cf.taste.similarity.UserSimilarity similarity,
DataModelFactory model)
Method to build a Neighborhood algorithm.
|
Modifier and Type | Method and Description |
---|---|
long[] |
getUserNeighborhood(long l) |
void |
refresh(Collection<org.apache.mahout.cf.taste.common.Refreshable> collection) |
@Inject public MahoutUserNeighborhood(String type, int n, @Nullable double threshold, org.apache.mahout.cf.taste.similarity.UserSimilarity similarity, DataModelFactory model)
type
- select the algorithm type: NearestN or Threshold.n
- number of users to recover. It is used if the algorithm type is NearestN.threshold
- threshold to recover users. It is used if the algorithm type is Threshold.similarity
- similarity function used in the algorithm.model
- data model to apply this algorithm.public long[] getUserNeighborhood(long l) throws org.apache.mahout.cf.taste.common.TasteException
getUserNeighborhood
in interface org.apache.mahout.cf.taste.neighborhood.UserNeighborhood
org.apache.mahout.cf.taste.common.TasteException
public void refresh(Collection<org.apache.mahout.cf.taste.common.Refreshable> collection)
refresh
in interface org.apache.mahout.cf.taste.common.Refreshable
Copyright © 2019. All rights reserved.