edu.stanford.nlp.maxent
Class Experiments

java.lang.Object
  extended by edu.stanford.nlp.maxent.Experiments
Direct Known Subclasses:
TaggerExperiments

public class Experiments
extends java.lang.Object

This class represents the training samples. It can return statistics of them, for example the frequency of each x or y in the training data


Field Summary
protected  int[] maxY
           
protected static int number
          number is the number of Experiments
protected  int[] px
          px[x] holds the number of times the history x appeared in training data py[y] holds the number of times the outcome y appeared in training data
protected static int[][] pxy
          pxy[x][y]=# times (x,y) occurred in training
protected  int[] py
           
 double[][] values
          The value of classification y for x used for ranknig
static int[][] vArray
          vArray has dimensions [numTraining][2] and holds the x and y for each training sample.
static int xSize
           
static int ySize
           
 
Constructor Summary
Experiments()
           
Experiments(int[][] vArray)
          If this constructor is used, the maximum possible class overall is found and all classes are assumed possible for all instances
Experiments(int[][] vArray, int ySize)
           
Experiments(int[][] vArray, int[] maxYs)
          The number of possible classes for each instance is contained in the array maxYs then the possible classes for x are from 0 to maxYs[x]-1
Experiments(java.lang.String filename)
          The filename has format: xSizeySize x1 y1 x2 y2 ..
 
Method Summary
 void add(Experiments m)
           
 Index createIndex()
           
 int[] get(int index)
           
 int getNumber()
           
static void main(java.lang.String[] args)
           
 int numY(int x)
           
 void print()
           
 void print(PrintFile pf)
           
 void ptilde()
           
 void ptilde(int ySize)
           
 double ptildeX(int x)
           
 double ptildeXY(int x, int y)
           
 double ptildeY(int y)
           
 void read(java.lang.String filename)
           
 void save(java.lang.String filename)
           
 void setMaxY(int[] maxY)
           
static int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vArray

public static int[][] vArray
vArray has dimensions [numTraining][2] and holds the x and y for each training sample.


number

protected static int number
number is the number of Experiments


px

protected int[] px
px[x] holds the number of times the history x appeared in training data py[y] holds the number of times the outcome y appeared in training data


py

protected int[] py

maxY

protected int[] maxY

pxy

protected static int[][] pxy
pxy[x][y]=# times (x,y) occurred in training


xSize

public static int xSize

ySize

public static int ySize

values

public double[][] values
The value of classification y for x used for ranknig

Constructor Detail

Experiments

public Experiments()

Experiments

public Experiments(int[][] vArray)
If this constructor is used, the maximum possible class overall is found and all classes are assumed possible for all instances

Parameters:
vArray -

Experiments

public Experiments(int[][] vArray,
                   int[] maxYs)
The number of possible classes for each instance is contained in the array maxYs then the possible classes for x are from 0 to maxYs[x]-1

Parameters:
vArray -

Experiments

public Experiments(int[][] vArray,
                   int ySize)

Experiments

public Experiments(java.lang.String filename)
The filename has format: xSizeySize x1 y1 x2 y2 .. ..

Method Detail

getNumber

public int getNumber()

createIndex

public Index createIndex()

add

public void add(Experiments m)

ptilde

public void ptilde()

setMaxY

public void setMaxY(int[] maxY)

numY

public int numY(int x)

ptilde

public void ptilde(int ySize)

ptildeX

public double ptildeX(int x)

ptildeY

public double ptildeY(int y)

ptildeXY

public double ptildeXY(int x,
                       int y)

get

public int[] get(int index)

size

public static int size()

print

public void print()

print

public void print(PrintFile pf)

save

public void save(java.lang.String filename)

read

public void read(java.lang.String filename)

main

public static void main(java.lang.String[] args)