public class SamplingUtility
extends java.lang.Object
Constructor and Description |
---|
SamplingUtility() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.Object,java.lang.Integer> |
getObservationFrequencies(java.util.Collection list)
This method returns the list of different observations and their frequency.
|
static java.util.List<?> |
getSample(java.util.List<?> population,
int sampleSize)
This method returns a sample from a population drawn according to a random sample without replacement.
|
static java.util.List<?> |
getSample(java.util.List<?> population,
int sampleSize,
boolean withReplacement)
This method returns a sample from a population.
|
static java.util.Map |
getSample(java.util.Map population,
int sampleSize)
This method returns a sample from a population drawn without replacement..
|
public static java.util.List<?> getSample(java.util.List<?> population, int sampleSize, boolean withReplacement)
population
- a List instance with the populationsampleSize
- an integerwithReplacement
- true if sampling with replacement or false otherwisepublic static java.util.Map<java.lang.Object,java.lang.Integer> getObservationFrequencies(java.util.Collection list)
list
- a population or a samplepublic static java.util.List<?> getSample(java.util.List<?> population, int sampleSize)
population
- a List instance with the populationsampleSize
- an integerpublic static java.util.Map getSample(java.util.Map population, int sampleSize)
population
- a Map instance with the populationsampleSize
- an integer