edu.umass.cs.mallet.projects.seg_plus_coref.condclust.pipe.iterator
Class NodeClusterPairIterator

java.lang.Object
  extended byedu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
      extended byedu.umass.cs.mallet.projects.seg_plus_coref.condclust.pipe.iterator.NodeClusterPairIterator
All Implemented Interfaces:
java.util.Iterator, PipeInputIterator

public class NodeClusterPairIterator
extends AbstractPipeInputIterator

Generates instances of NodeClusterPairs by one of two ways: (1) randomly clustering the data following the Chinese-restaurant style generative process, or (2) given the true clustering, generate NodeClusterPairs by sampling from the true clusters. Assumes for now that all clusters are pure (i.e. always make correct clustering decisions).


Field Summary
 
Fields inherited from class edu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
parentInstance
 
Constructor Summary
NodeClusterPairIterator(java.util.Collection clusters, java.util.Random r, double positiveInstanceRatio, boolean generateSampledInstances)
           
NodeClusterPairIterator(java.util.Collection clusters, java.util.Random r, double positiveInstanceRatio, boolean generateSampledInstances, int sampleSize)
          Randomly choose nodes and build clusters.
NodeClusterPairIterator(java.util.List data)
           
 
Method Summary
 boolean hasNext()
           
 java.lang.Object next()
           
 Instance nextInstance()
           
 void remove()
           
 
Methods inherited from class edu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
setParentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeClusterPairIterator

public NodeClusterPairIterator(java.util.Collection clusters,
                               java.util.Random r,
                               double positiveInstanceRatio,
                               boolean generateSampledInstances,
                               int sampleSize)
Randomly choose nodes and build clusters. Each time we must decide whether a node belongs in an existing cluster, we make a nodeClusterPair instance.

Parameters:
clusters - true clustering
r - for randomly selecting nodes to cluster
generateSampledInstances - sample positive instances from true clusters by sampling
sampleSize - number of training instances

NodeClusterPairIterator

public NodeClusterPairIterator(java.util.Collection clusters,
                               java.util.Random r,
                               double positiveInstanceRatio,
                               boolean generateSampledInstances)

NodeClusterPairIterator

public NodeClusterPairIterator(java.util.List data)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
Specified by:
hasNext in class AbstractPipeInputIterator

nextInstance

public Instance nextInstance()
Specified by:
nextInstance in interface PipeInputIterator
Specified by:
nextInstance in class AbstractPipeInputIterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator
Overrides:
next in class AbstractPipeInputIterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator
Overrides:
remove in class AbstractPipeInputIterator