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

Constructor Summary
`ZScore(DataModel dataModel)`

Method Summary
`float` `getTransformedValue(Preference pref)`
`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

### ZScore

    public ZScore(DataModel dataModel)

Method Detail

### getTransformedValue

    public float getTransformedValue(Preference pref)
                              throws TasteException

  Specified by:
    `getTransformedValue` in interface `PreferenceTransform`
  Throws:
    `TasteException`

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