## org.apache.mahout.classifier.sgd
Class DefaultGradient

    java.lang.Object
      org.apache.mahout.classifier.sgd.DefaultGradient

All Implemented Interfaces:
  Gradient

    public class DefaultGradient

extends Object
implements Gradient

Implements the basic logistic training law.

Constructor Summary
`DefaultGradient()`

Method Summary
`Vector` `apply(String groupKey, int actual, Vector instance, AbstractVectorClassifier classifier)` Provides a default gradient computation useful for logistic regression.

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

Constructor Detail

### DefaultGradient

    public DefaultGradient()

Method Detail

### apply

    public final Vector apply(String groupKey,
                              int actual,
                              Vector instance,
                              AbstractVectorClassifier classifier)

  Provides a default gradient computation useful for logistic regression.

  Specified by:
    `apply` in interface `Gradient`
  Parameters:
    `groupKey` - A grouping key to allow per-something AUC loss to be used for training.
    `actual` - The target variable value.
    `instance` - The current feature vector to use for gradient computation
    `classifier` - The classifier that can compute scores
  Returns:
    The gradient to be applied to beta

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