|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.cf.taste.impl.transforms.CaseAmplification
public final class CaseAmplification
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(Collection<Refreshable> alreadyRefreshed)
Triggers "refresh" -- whatever that means -- of the implementation. |
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 |
---|
public CaseAmplification(double factor)
Creates a transformation based on the given factor.
factor
- transformation factor
IllegalArgumentException
- if factor is 0.0 or Double.NaN
Method Detail |
---|
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.
transformSimilarity
in interface SimilarityTransform
id1
- unusedid2
- unusedvalue
- similarity to transform
value<sup>factor</sup>
if value is nonnegative;
-value<sup>-factor</sup>
otherwisepublic void refresh(Collection<Refreshable> alreadyRefreshed)
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.
refresh
in interface Refreshable
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.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |