de.aitools.iv.mds.util
Class Randomizer
java.lang.Object
de.aitools.iv.mds.util.Randomizer
public class Randomizer
- extends java.lang.Object
- Author:
- Anita
Method Summary |
static java.util.ArrayList<java.lang.Integer> |
randomPartialSubset(java.util.ArrayList<java.lang.Integer> subset,
int amount)
Generates a random sample of defined size of input subset and removes sampled indices from
input subset. |
static int[] |
randomSample(java.util.ArrayList<java.lang.Integer> set,
int amount)
Generates a random sample of defined size of input set. |
static java.util.ArrayList<java.lang.Integer> |
randomSample(int elements,
int amount)
Generates a random sample of defined size from an amount of elements. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Randomizer
public Randomizer()
randomSample
public static int[] randomSample(java.util.ArrayList<java.lang.Integer> set,
int amount)
- Generates a random sample of defined size of input set.
- Parameters:
set
- input set to sample fromamount
- size of sample to be created
- Returns:
- int array with indices of sampled objects
randomSample
public static java.util.ArrayList<java.lang.Integer> randomSample(int elements,
int amount)
- Generates a random sample of defined size from an amount of elements. It is assumed that
indices to choose from are 0..(elements-1).
- Parameters:
elements
- number of elements to sample fromamount
- size of sample to be created
- Returns:
- ArrayList with indices of sampled objects
randomPartialSubset
public static java.util.ArrayList<java.lang.Integer> randomPartialSubset(java.util.ArrayList<java.lang.Integer> subset,
int amount)
- Generates a random sample of defined size of input subset and removes sampled indices from
input subset.
- Parameters:
subset
- ArrayList with indices to sample fromamount
- size of sample to be created
- Returns:
- ArrayList with indices of sampled objects removed from subset