KEY - Type of groupsINSTANCE - Type of instancespublic class StratifiedGroupedUniformRandomisedSampler<KEY,INSTANCE> extends Object implements Sampler<org.openimaj.data.dataset.GroupedDataset<KEY,org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE>>
| Constructor and Description |
|---|
StratifiedGroupedUniformRandomisedSampler(double percentage)
Construct a
StratifiedGroupedUniformRandomisedSampler
with the given percentage of instances to select. |
StratifiedGroupedUniformRandomisedSampler(double percentage,
boolean withReplacement)
Construct a
StratifiedGroupedUniformRandomisedSampler
with the given percentage of instances to select, using with
with-replacement or without-replacement sampling. |
StratifiedGroupedUniformRandomisedSampler(int number)
Construct a
StratifiedGroupedUniformRandomisedSampler
with the given number of instances to select. |
StratifiedGroupedUniformRandomisedSampler(int number,
boolean withReplacement)
Construct a
StratifiedGroupedUniformRandomisedSampler
with the given number of instances to select, using with with-replacement
or without-replacement sampling. |
| 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,org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> dataset)
Perform the sampling operation on the given data
and return the sampled dataset.
|
public StratifiedGroupedUniformRandomisedSampler(double percentage)
StratifiedGroupedUniformRandomisedSampler
with the given percentage of instances to select. By default, the
sampling is without replacement (i.e. an instance can only be selected
once).percentage - percentage of instances to selectpublic StratifiedGroupedUniformRandomisedSampler(double percentage, boolean withReplacement)
StratifiedGroupedUniformRandomisedSampler
with the given percentage of instances to select, using with
with-replacement or without-replacement sampling.percentage - percentage of instances to selectwithReplacement - should the sampling be performed with replacement (true); or
without replacement (false).public StratifiedGroupedUniformRandomisedSampler(int number)
StratifiedGroupedUniformRandomisedSampler
with the given number of instances to select. By default, the sampling is
without replacement (i.e. an instance can only be selected once).number - number of instances to selectpublic StratifiedGroupedUniformRandomisedSampler(int number, boolean withReplacement)
StratifiedGroupedUniformRandomisedSampler
with the given number of instances to select, using with with-replacement
or without-replacement sampling.number - number of instances to selectwithReplacement - should the sampling be performed with replacement (true); or
without replacement (false).public org.openimaj.data.dataset.GroupedDataset<KEY,org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> sample(org.openimaj.data.dataset.GroupedDataset<KEY,org.openimaj.data.dataset.ListDataset<INSTANCE>,INSTANCE> dataset)
Sampler