KEY - Type of groupsINSTANCE - Type of instancespublic class StratifiedGroupedUniformRandomisedSampler<KEY,INSTANCE> extends Object implements Sampler<GroupedDataset<KEY,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 |
|---|---|
GroupedDataset<KEY,ListDataset<INSTANCE>,INSTANCE> |
sample(GroupedDataset<KEY,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 GroupedDataset<KEY,ListDataset<INSTANCE>,INSTANCE> sample(GroupedDataset<KEY,ListDataset<INSTANCE>,INSTANCE> dataset)
Samplersample in interface Sampler<GroupedDataset<KEY,ListDataset<INSTANCE>,INSTANCE>>dataset - the dataset to sample