edu.stanford.nlp.cluster
Class HiddenState

java.lang.Object
  |
  +--edu.stanford.nlp.cluster.SimpleCluster
        |
        +--edu.stanford.nlp.cluster.HiddenState
All Implemented Interfaces:
Cloneable, Cluster

public class HiddenState
extends SimpleCluster

Data Structure for clusters in LSSA.

HiddenState is a subclass of SimpleCluster which is specifically tailored towards HMM-based clustering methods. This differs from SoftCluster in that it stores an array of transition probabilities from this hidden class to each of the other hidden classes. In addition, it stores growable forward_trellis and backward_trellis Arrays that give the probability of the hidden state at each time step t given an observation sequence O.


Field Summary
 
Fields inherited from class edu.stanford.nlp.cluster.SimpleCluster
index, mean, nd, nt, pr_d_z, pr_w_z, pr_z, scatter
 
Constructor Summary
HiddenState(int num_terms, int num_docs, int num_states)
          Constructor: allocates memory for arrays, but does not initializes values
HiddenState(int num_terms, int num_docs, int num_states, int i)
           
 
Method Summary
 Object clone()
          overwrites Cluster.clone() so that all the additional structures in HiddenState are also copied to its clone
 ScientificNotationDouble get_a(int j)
           
 ScientificNotationDouble get_alpha(int d, int t)
           
 ScientificNotationDouble get_b(int w)
           
 ScientificNotationDouble get_beta(int d, int t)
           
 ScientificNotationDouble get_pi()
           
 void initialize_alpha(Array O)
           
 void initialize_alpha(DataCollection db)
          allocates memory for alpha[][]
 void initialize_alpha(int d, Array O)
          allocates memory for alpha[d]
 void initialize_beta(Array O)
           
 void initialize_beta(DataCollection db)
          allocates memory for beta[][]
 void initialize_beta(int d, Array O)
          allocates memory for beta[d]
 void initialize_transition_probs()
          Initialize: initializes random values pr_transition[], an array of transition probabilities from this state to all the other states Note: does not initialize values for pi (the probability that this class is the initial state) because the value for pi depends on the value for pi of all the other clusters, since sum_over_z(pi)=1 The value for pi is set in LSSA
 void print_pr_transition()
           
 void print_trellis()
           
 void set_a(int j, ScientificNotationDouble value)
           
 void set_alpha(int d, int t, ScientificNotationDouble value)
           
 void set_alpha(ScientificNotationDouble[][] al)
           
 void set_b(int w, ScientificNotationDouble value)
           
 void set_beta(int d, int t, ScientificNotationDouble value)
           
 void set_beta(ScientificNotationDouble[][] bet)
           
 void set_pi(ScientificNotationDouble p)
           
 String toString(DataCollection dbm)
          Returns String representation of Cluster prints default number of features and data.
 String toXMLString(int tnf, int tnd, DataCollection dbm)
          Returns XML String representation of Cluster
 
Methods inherited from class edu.stanford.nlp.cluster.SimpleCluster
clearData, equals, evaluateIntraSimilarity, evaluateWeightedMean, get_pr_d_z, get_pr_d_z, get_pr_w_z, get_pr_w_z, get_pr_z, getIndex, getIntraSimilarity, getMean, set_pr_d_z, set_pr_d_z, set_pr_w_z, set_pr_w_z, set_pr_z, setIndex, toString, toXMLString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HiddenState

public HiddenState(int num_terms,
                   int num_docs,
                   int num_states)
Constructor: allocates memory for arrays, but does not initializes values


HiddenState

public HiddenState(int num_terms,
                   int num_docs,
                   int num_states,
                   int i)
Method Detail

initialize_transition_probs

public void initialize_transition_probs()
Initialize: initializes random values pr_transition[], an array of transition probabilities from this state to all the other states Note: does not initialize values for pi (the probability that this class is the initial state) because the value for pi depends on the value for pi of all the other clusters, since sum_over_z(pi)=1 The value for pi is set in LSSA


initialize_alpha

public void initialize_alpha(Array O)

initialize_beta

public void initialize_beta(Array O)

initialize_alpha

public void initialize_alpha(DataCollection db)
allocates memory for alpha[][]


initialize_beta

public void initialize_beta(DataCollection db)
allocates memory for beta[][]


initialize_alpha

public void initialize_alpha(int d,
                             Array O)
allocates memory for alpha[d]


initialize_beta

public void initialize_beta(int d,
                            Array O)
allocates memory for beta[d]


get_alpha

public ScientificNotationDouble get_alpha(int d,
                                          int t)

get_beta

public ScientificNotationDouble get_beta(int d,
                                         int t)

get_a

public ScientificNotationDouble get_a(int j)

print_pr_transition

public void print_pr_transition()

get_b

public ScientificNotationDouble get_b(int w)

set_alpha

public void set_alpha(ScientificNotationDouble[][] al)

set_beta

public void set_beta(ScientificNotationDouble[][] bet)

set_alpha

public void set_alpha(int d,
                      int t,
                      ScientificNotationDouble value)

set_beta

public void set_beta(int d,
                     int t,
                     ScientificNotationDouble value)

set_a

public void set_a(int j,
                  ScientificNotationDouble value)

set_b

public void set_b(int w,
                  ScientificNotationDouble value)

set_pi

public void set_pi(ScientificNotationDouble p)

get_pi

public ScientificNotationDouble get_pi()

clone

public Object clone()
overwrites Cluster.clone() so that all the additional structures in HiddenState are also copied to its clone

Specified by:
clone in interface Cluster
Overrides:
clone in class SimpleCluster

toString

public String toString(DataCollection dbm)
Description copied from interface: Cluster
Returns String representation of Cluster prints default number of features and data. (normally 20)

Specified by:
toString in interface Cluster
Overrides:
toString in class SimpleCluster

print_trellis

public void print_trellis()

toXMLString

public String toXMLString(int tnf,
                          int tnd,
                          DataCollection dbm)
Description copied from interface: Cluster
Returns XML String representation of Cluster

Specified by:
toXMLString in interface Cluster
Overrides:
toXMLString in class SimpleCluster
Parameters:
tnf - top n features. prints top tnf features with largest probabilities
tnd - top n datums. prints top tnd datums with largest probabilities


Stanford NLP Group