Package cc.mallet.cluster.iterator
Class PairSampleIterator
- java.lang.Object
-
- cc.mallet.cluster.iterator.NeighborIterator
-
- 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
Fields Modifier and Type Field Description 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
Constructors Constructor Description PairSampleIterator(Clustering clustering, Randoms random, double positiveProportion, int numberSamples)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Instance
next()
-
Methods inherited from class cc.mallet.cluster.iterator.NeighborIterator
getClustering, remove
-
-
-
-
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()
-
-