[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
SamplerOptions Class Reference |
Options object for the Sampler class. More...
#include <vigra/sampling.hxx>
Public Member Functions | |
SamplerOptions & | sampleProportion (double proportion) |
Determine the number of samples to draw as a proportion of the total number. That is, we draw count = totalCount * proportion samples. This option is overridden when an absolute count is specified by sampleSize(). More... | |
SamplerOptions & | sampleSize (unsigned int size) |
Draw the given number of samples. If stratifiedSampling is true, the size is equally distributed across all strata (e.g. size / strataCount samples are taken from each stratum, subject to rounding). More... | |
SamplerOptions & | stratified (bool in=true) |
Draw equally many samples from each "stratum". A stratum is a group of like entities, e.g. pixels belonging to the same object class. This is useful to create balanced samples when the class probabilities are very unbalanced (e.g. when there are many background and few foreground pixels). Stratified sampling thus avoids that a trained classifier is biased towards the majority class. More... | |
SamplerOptions & | withoutReplacement (bool in=true) |
Sample from training population without replacement. More... | |
SamplerOptions & | withReplacement (bool in=true) |
Sample from training population with replacement. More... | |
Options object for the Sampler class.
Usage:
Note that the return value of all methods is *this
which makes concatenating of options as above possible.
SamplerOptions& withReplacement | ( | bool | in = true | ) |
Sample from training population with replacement.
Default: true
SamplerOptions& withoutReplacement | ( | bool | in = true | ) |
Sample from training population without replacement.
Default (if you don't call this function): false
SamplerOptions& sampleSize | ( | unsigned int | size | ) |
Draw the given number of samples. If stratifiedSampling is true, the size is equally distributed across all strata (e.g. size / strataCount
samples are taken from each stratum, subject to rounding).
Default: 0 (i.e. determine the count by means of sampleProportion())
SamplerOptions& sampleProportion | ( | double | proportion | ) |
Determine the number of samples to draw as a proportion of the total number. That is, we draw count = totalCount * proportion
samples. This option is overridden when an absolute count is specified by sampleSize().
If stratifiedSampling is true, the count is equally distributed across all strata (e.g. totalCount * proportion / strataCount
samples are taken from each stratum).
Default: 1.0
SamplerOptions& stratified | ( | bool | in = true | ) |
Draw equally many samples from each "stratum". A stratum is a group of like entities, e.g. pixels belonging to the same object class. This is useful to create balanced samples when the class probabilities are very unbalanced (e.g. when there are many background and few foreground pixels). Stratified sampling thus avoids that a trained classifier is biased towards the majority class.
Default (if you don't call this function): false
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|