edu.stanford.nlp.classify
Class LogisticObjectiveFunction

java.lang.Object
  extended by edu.stanford.nlp.optimization.AbstractCachingDiffFunction
      extended by edu.stanford.nlp.classify.LogisticObjectiveFunction
All Implemented Interfaces:
DiffFunction, Function, HasInitial

public class LogisticObjectiveFunction
extends AbstractCachingDiffFunction

Maximizes the conditional likelihood with a given prior. Because the problem is binary, optimizations are possible that cannot be done in LogConditionalObjectiveFunction.

Author:
Galen Andrew

Field Summary
protected  float[] dataweights
           
 
Fields inherited from class edu.stanford.nlp.optimization.AbstractCachingDiffFunction
derivative, value
 
Constructor Summary
LogisticObjectiveFunction(int numFeatures, int[][] data, double[][] values, int[] labels)
           
LogisticObjectiveFunction(int numFeatures, int[][] data, double[][] values, int[] labels, float[] dataweights)
           
LogisticObjectiveFunction(int numFeatures, int[][] data, double[][] values, int[] labels, LogPrior prior)
           
LogisticObjectiveFunction(int numFeatures, int[][] data, double[][] values, int[] labels, LogPrior prior, float[] dataweights)
           
LogisticObjectiveFunction(int numFeatures, int[][] data, int[] labels)
           
LogisticObjectiveFunction(int numFeatures, int[][] data, int[] labels, float[] dataweights)
           
LogisticObjectiveFunction(int numFeatures, int[][] data, int[] labels, LogPrior prior)
           
LogisticObjectiveFunction(int numFeatures, int[][] data, int[] labels, LogPrior prior, float[] dataweights)
           
 
Method Summary
protected  void calculate(double[] x)
          Calculate the value at x and the derivative and save them in the respective fields
protected  void calculateRVF(double[] x)
           
 int domainDimension()
          Returns the number of dimensions in the function's domain
 
Methods inherited from class edu.stanford.nlp.optimization.AbstractCachingDiffFunction
clearCache, copy, derivativeAt, initial, lastValue, setValue, valueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataweights

protected float[] dataweights
Constructor Detail

LogisticObjectiveFunction

public LogisticObjectiveFunction(int numFeatures,
                                 int[][] data,
                                 int[] labels)

LogisticObjectiveFunction

public LogisticObjectiveFunction(int numFeatures,
                                 int[][] data,
                                 int[] labels,
                                 LogPrior prior)

LogisticObjectiveFunction

public LogisticObjectiveFunction(int numFeatures,
                                 int[][] data,
                                 int[] labels,
                                 float[] dataweights)

LogisticObjectiveFunction

public LogisticObjectiveFunction(int numFeatures,
                                 int[][] data,
                                 int[] labels,
                                 LogPrior prior,
                                 float[] dataweights)

LogisticObjectiveFunction

public LogisticObjectiveFunction(int numFeatures,
                                 int[][] data,
                                 double[][] values,
                                 int[] labels)

LogisticObjectiveFunction

public LogisticObjectiveFunction(int numFeatures,
                                 int[][] data,
                                 double[][] values,
                                 int[] labels,
                                 LogPrior prior)

LogisticObjectiveFunction

public LogisticObjectiveFunction(int numFeatures,
                                 int[][] data,
                                 double[][] values,
                                 int[] labels,
                                 float[] dataweights)

LogisticObjectiveFunction

public LogisticObjectiveFunction(int numFeatures,
                                 int[][] data,
                                 double[][] values,
                                 int[] labels,
                                 LogPrior prior,
                                 float[] dataweights)
Method Detail

domainDimension

public int domainDimension()
Description copied from interface: Function
Returns the number of dimensions in the function's domain

Specified by:
domainDimension in interface Function
Specified by:
domainDimension in class AbstractCachingDiffFunction
Returns:
the number of domain dimensions

calculate

protected void calculate(double[] x)
Description copied from class: AbstractCachingDiffFunction
Calculate the value at x and the derivative and save them in the respective fields

Specified by:
calculate in class AbstractCachingDiffFunction

calculateRVF

protected void calculateRVF(double[] x)


Stanford NLP Group