edu.umass.cs.mallet.projects.seg_plus_coref.condclust.pipe.iterator
Class NodeClusterPairIterator
java.lang.Object
edu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
edu.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).
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 clusteringr
- for randomly selecting nodes to clustergenerateSampledInstances
- sample positive instances from true clusters by samplingsampleSize
- 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)
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