org.apache.mahout.cf.taste.impl.transforms
Class ZScore
java.lang.Object
org.apache.mahout.cf.taste.impl.transforms.ZScore
- All Implemented Interfaces:
- Refreshable, PreferenceTransform
public final class ZScore
- extends Object
- implements PreferenceTransform
Normalizes preference values for a user by converting them to "z-scores". This process normalizes preference values
to adjust for variation in mean and variance of a user's preferences.
Imagine two users, one who tends to rate every movie he/she sees four or five stars, and another who uses
the full one to five star range when assigning ratings. This transform normalizes away the difference in
scale used by the two users so that both have a mean preference of 0.0 and a standard deviation of 1.0.
ZScore
public ZScore(DataModel dataModel)
getTransformedValue
public float getTransformedValue(Preference pref)
throws TasteException
- Specified by:
getTransformedValue
in interface PreferenceTransform
- Throws:
TasteException
refresh
public void refresh(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 String toString()
- Overrides:
toString
in class Object
Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.