public class Bagging
extends java.lang.Object
Leo Breiman (1996). Bagging predictors. Machine Learning, 24(2):123-140.
Modifier and Type | Method | Description |
---|---|---|
int |
getBagSizePercent() |
|
double[] |
getEqualWeights(MemoryContainer learningContainer) |
|
double[] |
getHVDMVCWeights(ApproximatedEntityContainer container,
ConsistencyMeasure measure) |
|
java.util.Random |
getRandomNumberGenerator(long seed) |
Returns a random number generator.
|
double[] |
getVCWeights(ApproximatedEntityContainer container,
ConsistencyMeasure measure) |
|
MemoryContainer |
noReplacementSampleWithWeights(MemoryContainer data,
java.util.Random generator,
double[] weights,
boolean[] sampled) |
Creates a new dataset of the same size using random sampling
without replacement according to the given weight vector.
|
MemoryContainer |
replacementSampleWithWeights(MemoryContainer data,
java.util.Random generator,
double[] weights,
boolean[] sampled) |
Creates a new dataset of the same size using random sampling
with replacement according to the given weight vector.
|
MemoryContainer |
resampleWithWeights(MemoryContainer data,
java.util.Random generator,
boolean replacement,
double[] weights,
boolean[] sampled) |
Creates a new dataset of the same size using random sampling
according to replacement option value and to the given weight vector.
|
void |
setBagSizePercent(int bagSizePercent) |
public MemoryContainer replacementSampleWithWeights(MemoryContainer data, java.util.Random generator, double[] weights, boolean[] sampled)
data
- set the data set to be sampled fromgenerator
- a random number generatorweights
- vector containig weights to be used in samplingsampled
- vector indicating which instance has been sampledjava.lang.IllegalArgumentException
- if the weights array is of the wrong
length or contains negative weights.public MemoryContainer noReplacementSampleWithWeights(MemoryContainer data, java.util.Random generator, double[] weights, boolean[] sampled)
data
- set the data set to be sampled fromgenerator
- a random number generatorweights
- vector containig weights to be used in samplingsampled
- vector indicating which instance has been sampledjava.lang.IllegalArgumentException
- if the weights array is of the wrong
length or contains negative weights.public MemoryContainer resampleWithWeights(MemoryContainer data, java.util.Random generator, boolean replacement, double[] weights, boolean[] sampled)
data
- set the data set to be sampled fromgenerator
- a random number generatorreplacement
- indicates whether a replecemnt is madeweights
- vector containig weights to be used in samplingsampled
- vector indicating which instance has been sampledjava.lang.IllegalArgumentException
- if the weights array is of the wrong
length or contains negative weights.public int getBagSizePercent()
public void setBagSizePercent(int bagSizePercent)
public double[] getEqualWeights(MemoryContainer learningContainer)
public double[] getHVDMVCWeights(ApproximatedEntityContainer container, ConsistencyMeasure measure)
public double[] getVCWeights(ApproximatedEntityContainer container, ConsistencyMeasure measure)
public java.util.Random getRandomNumberGenerator(long seed)
memoryContainer
chosen based on the given seed.seed
- the given seed