## org.apache.mahout.cf.taste.impl.transforms
Class CaseAmplification

    java.lang.Object
      org.apache.mahout.cf.taste.impl.transforms.CaseAmplification

All Implemented Interfaces:
  Refreshable, SimilarityTransform

    public final class CaseAmplification

extends java.lang.Object
implements SimilarityTransform

Applies "case amplification" to similarities. This essentially makes big values bigger and small values smaller by raising each score to a power. It could however be used to achieve the opposite effect.

Constructor Summary
`CaseAmplification(double factor)` Creates a transformation based on the given factor.

Method Summary
`void` `refresh(java.util.Collection<Refreshable> alreadyRefreshed)` Triggers "refresh" -- whatever that means -- of the implementation.
`java.lang.String` `toString()`
`double` `transformSimilarity(long id1, long id2, double value)` Transforms one similarity value.

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

Constructor Detail

### CaseAmplification

    public CaseAmplification(double factor)

  Creates a transformation based on the given factor.

  Parameters:
    `factor` - transformation factor
  Throws:
    `java.lang.IllegalArgumentException` - if factor is 0.0 or `Double.NaN`

Method Detail

### transformSimilarity

    public double transformSimilarity(long id1,
                                      long id2,
                                      double value)

  Transforms one similarity value. This implementation is such that it's possible to define this transformation on one value in isolation. The "thing" parameters are therefore unused.

  Specified by:
    `transformSimilarity` in interface `SimilarityTransform`
  Parameters:
    `id1` - unused
    `id2` - unused
    `value` - similarity to transform
  Returns:
    `valuefactor` if value is nonnegative; `-value-factor` otherwise

### 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.