cc.mallet.cluster.iterator
Class PairSampleIterator

java.lang.Object
  extended by cc.mallet.cluster.iterator.NeighborIterator
      extended by cc.mallet.cluster.iterator.PairSampleIterator
All Implemented Interfaces:
java.util.Iterator<Instance>
Direct Known Subclasses:
ClusterSampleIterator

public class PairSampleIterator
extends NeighborIterator

Sample pairs of Instances.

Since:
1.0
Version:
1.0
Author:
"Aron Culotta"
See Also:
NeighborIterator

Field Summary
protected  InstanceList instances
           
protected  int[] nonsingletonClusters
           
protected  int numberSamples
           
protected  int positiveCount
           
protected  double positiveProportion
           
protected  int positiveTarget
           
protected  Randoms random
           
protected  int totalCount
           
 
Fields inherited from class cc.mallet.cluster.iterator.NeighborIterator
clustering
 
Constructor Summary
PairSampleIterator(Clustering clustering, Randoms random, double positiveProportion, int numberSamples)
           
 
Method Summary
 boolean hasNext()
           
 Instance next()
           
 
Methods inherited from class cc.mallet.cluster.iterator.NeighborIterator
getClustering, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instances

protected InstanceList instances

random

protected Randoms random

positiveProportion

protected double positiveProportion

numberSamples

protected int numberSamples

positiveTarget

protected int positiveTarget

positiveCount

protected int positiveCount

totalCount

protected int totalCount

nonsingletonClusters

protected int[] nonsingletonClusters
Constructor Detail

PairSampleIterator

public PairSampleIterator(Clustering clustering,
                          Randoms random,
                          double positiveProportion,
                          int numberSamples)
Parameters:
clustering - True clustering.
random - Source of randomness.
positiveProportion - Proportion of Instances that should be positive examples.
numberSamples - Total number of samples to generate.
Method Detail

hasNext

public boolean hasNext()

next

public Instance next()