org.apache.mahout.classifier.sgd
Class OnlineLogisticRegression

java.lang.Object
  extended by org.apache.mahout.classifier.AbstractVectorClassifier
      extended by org.apache.mahout.classifier.sgd.AbstractOnlineLogisticRegression
          extended by org.apache.mahout.classifier.sgd.OnlineLogisticRegression
All Implemented Interfaces:
Closeable, org.apache.hadoop.io.Writable, OnlineLearner

public class OnlineLogisticRegression
extends AbstractOnlineLogisticRegression
implements org.apache.hadoop.io.Writable

Extends the basic on-line logistic regression learner with a specific set of learning rate annealing schedules.


Field Summary
static int WRITABLE_VERSION
           
 
Fields inherited from class org.apache.mahout.classifier.sgd.AbstractOnlineLogisticRegression
beta, numCategories, prior, step, updateCounts, updateSteps
 
Constructor Summary
OnlineLogisticRegression()
           
OnlineLogisticRegression(int numCategories, int numFeatures, PriorFunction prior)
           
 
Method Summary
 OnlineLogisticRegression alpha(double alpha)
          Chainable configuration option.
 OnlineLogisticRegression copy()
           
 void copyFrom(OnlineLogisticRegression other)
           
 double currentLearningRate()
           
 OnlineLogisticRegression decayExponent(double decayExponent)
           
 OnlineLogisticRegression lambda(double lambda)
          Chainable configuration option.
 OnlineLogisticRegression learningRate(double learningRate)
          Chainable configuration option.
 double perTermLearningRate(int j)
           
 void readFields(DataInput in)
           
 OnlineLogisticRegression stepOffset(int stepOffset)
           
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.mahout.classifier.sgd.AbstractOnlineLogisticRegression
classify, classifyNoLink, classifyScalar, classifyScalarNoLink, close, copyFrom, getBeta, getLambda, getPrior, getStep, isSealed, link, link, nextStep, numCategories, numFeatures, regularize, setBeta, setGradient, setPrior, train, train, train, unseal, validModel
 
Methods inherited from class org.apache.mahout.classifier.AbstractVectorClassifier
classify, classifyFull, classifyFull, classifyFull, classifyScalar, logLikelihood
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WRITABLE_VERSION

public static final int WRITABLE_VERSION
See Also:
Constant Field Values
Constructor Detail

OnlineLogisticRegression

public OnlineLogisticRegression()

OnlineLogisticRegression

public OnlineLogisticRegression(int numCategories,
                                int numFeatures,
                                PriorFunction prior)
Method Detail

alpha

public OnlineLogisticRegression alpha(double alpha)
Chainable configuration option.

Parameters:
alpha - New value of decayFactor, the exponential decay rate for the learning rate.
Returns:
This, so other configurations can be chained.

lambda

public OnlineLogisticRegression lambda(double lambda)
Description copied from class: AbstractOnlineLogisticRegression
Chainable configuration option.

Overrides:
lambda in class AbstractOnlineLogisticRegression
Parameters:
lambda - New value of lambda, the weighting factor for the prior distribution.
Returns:
This, so other configurations can be chained.

learningRate

public OnlineLogisticRegression learningRate(double learningRate)
Chainable configuration option.

Parameters:
learningRate - New value of initial learning rate.
Returns:
This, so other configurations can be chained.

stepOffset

public OnlineLogisticRegression stepOffset(int stepOffset)

decayExponent

public OnlineLogisticRegression decayExponent(double decayExponent)

perTermLearningRate

public double perTermLearningRate(int j)
Specified by:
perTermLearningRate in class AbstractOnlineLogisticRegression

currentLearningRate

public double currentLearningRate()
Specified by:
currentLearningRate in class AbstractOnlineLogisticRegression

copyFrom

public void copyFrom(OnlineLogisticRegression other)

copy

public OnlineLogisticRegression copy()

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException


Copyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.