## org.apache.mahout.classifier.sgd
Interface PriorFunction

All Superinterfaces:
  org.apache.hadoop.io.Writable

All Known Implementing Classes:
  ElasticBandPrior, L1, L2, TPrior, UniformPrior

    public interface PriorFunction

extends org.apache.hadoop.io.Writable

A prior is used to regularize the learning algorithm. This allows a trade-off to be made between complexity of the model being learned and the accuracy with which the model fits the training data. There are different definitions of complexity which can be approximated using different priors. For large sparse systems, such as text classification, the L1 prior is often used which favors sparse models.

Method Summary
`double` `age(double oldValue, double generations, double learningRate)` Applies the regularization to a coefficient.
`double` `logP(double betaIJ)` Returns the log of the probability of a particular coefficient value according to the prior.

Methods inherited from interface org.apache.hadoop.io.Writable
`readFields, write`

Method Detail

### age

    double age(double oldValue,
               double generations,
               double learningRate)

  Applies the regularization to a coefficient.

  Parameters:
    `oldValue` - The previous value.
    `generations` - The number of generations.
    `learningRate` - The learning rate with lambda baked in.
  Returns:
    The new coefficient value after regularization.

### logP

    double logP(double betaIJ)

  Returns the log of the probability of a particular coefficient value according to the prior.

  Parameters:
    `betaIJ` - The coefficient.
  Returns:
    The log probability.

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.