## org.apache.mahout.cf.taste.impl.recommender
Class FarthestNeighborClusterSimilarity

    java.lang.Object
      org.apache.mahout.cf.taste.impl.recommender.FarthestNeighborClusterSimilarity

All Implemented Interfaces:
  Refreshable, ClusterSimilarity

    public final class FarthestNeighborClusterSimilarity

extends java.lang.Object
implements ClusterSimilarity

Defines cluster similarity as the smallest similarity between any two users in the clusters -- that is, it says that clusters are close when all pairs of their members have relatively high similarity.

Constructor Summary
`FarthestNeighborClusterSimilarity(UserSimilarity similarity)` Constructs a based on the given `UserSimilarity`.
`FarthestNeighborClusterSimilarity(UserSimilarity similarity, double samplingRate)` Constructs a based on the given `UserSimilarity`.

Method Summary
`double` `getSimilarity(FastIDSet cluster1, FastIDSet cluster2)`
`void` `refresh(java.util.Collection<Refreshable> alreadyRefreshed)` Triggers "refresh" -- whatever that means -- of the implementation.
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### FarthestNeighborClusterSimilarity

    public FarthestNeighborClusterSimilarity(UserSimilarity similarity)

  Constructs a based on the given `UserSimilarity`. All user-user similarities are examined.

### FarthestNeighborClusterSimilarity

    public FarthestNeighborClusterSimilarity(UserSimilarity similarity,
                                             double samplingRate)

  Constructs a based on the given `UserSimilarity`. By setting `samplingRate` to a value less than 1.0, this implementation will only examine that fraction of all user-user similarities between two clusters, increasing performance at the expense of accuracy.

Method Detail

### getSimilarity

    public double getSimilarity(FastIDSet cluster1,
                                FastIDSet cluster2)
                         throws TasteException

  Specified by:
    `getSimilarity` in interface `ClusterSimilarity`
  Parameters:
    `cluster1` - first cluster of user IDs
    `cluster2` - second cluster of user IDs
  Returns:
    "distance" between clusters; a bigger value means less similarity
  Throws:
    `TasteException` - if an error occurs while computing similarity, such as errors accessing an underlying `DataModel`

### refresh

    public void refresh(java.util.Collection<Refreshable> alreadyRefreshed)

  Description copied from interface: `Refreshable`

  Triggers "refresh" -- whatever that means -- of the implementation. The general contract is that any should always leave itself in a consistent, operational state, and that the refresh atomically updates internal state from old to new.

  Specified by:
    `refresh` in interface `Refreshable`
  Parameters:
    `alreadyRefreshed` - s that are known to have already been refreshed as a result of an initial call to a method on some object. This ensure that objects in a refresh dependency graph aren't refreshed twice needlessly.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.