KEY - Type of groupsINSTANCE - Type of instancespublic class GroupSampler<KEY,INSTANCE> extends Object implements Sampler<org.openimaj.data.dataset.GroupedDataset<KEY,? extends org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE>>
GroupedDataset. Groups are
either selected randomly or from the first ones returned by the iterator over
the dataset keys.| Constructor and Description |
|---|
GroupSampler(int numGroups,
boolean random)
Construct the sample to extract the given number of groups, either
randomly or by taking them in the order provided by the iterator of
groups.
|
| Modifier and Type | Method and Description |
|---|---|
org.openimaj.data.dataset.GroupedDataset<KEY,org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> |
sample(org.openimaj.data.dataset.GroupedDataset<KEY,? extends org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> dataset)
Perform the sampling operation on the given data
and return the sampled dataset.
|
static <KEY,INSTANCE> |
sample(org.openimaj.data.dataset.GroupedDataset<KEY,? extends org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> dataset,
int numGroups,
boolean random)
Sample a dataset with the given number of groups to select.
|
public GroupSampler(int numGroups, boolean random)
numGroups - the number of groupsrandom - should the sample groups be chosen randomly?public org.openimaj.data.dataset.GroupedDataset<KEY,org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> sample(org.openimaj.data.dataset.GroupedDataset<KEY,? extends org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> dataset)
Samplerpublic static <KEY,INSTANCE> org.openimaj.data.dataset.GroupedDataset<KEY,org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> sample(org.openimaj.data.dataset.GroupedDataset<KEY,? extends org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> dataset, int numGroups, boolean random)
dataset - the dataset to samplenumGroups - the number of groupsrandom - should the sample groups be chosen randomly?