V
- Vector type@Description(value="Add uniform Jitter to a dataset, while preserving the total vector sum.") public class HistogramJitterFilter<V extends NumberVector<?>> extends AbstractVectorStreamConversionFilter<V,V>
jitter * scale
is
added and the result normalized to the original vectors sum. The individual
dimensions are drawn from an exponential distribution with scale
jitter / dimensionality
, so it is expected that the error in
most dimensions will be low, and higher in few.
This is designed to degrade the quality of a histogram, while preserving the
total sum (e.g. to keep the normalization). The factor "jitter" can be used
to control the degradation amount.Modifier and Type | Class and Description |
---|---|
static class |
HistogramJitterFilter.Parameterizer
Parameterization class.
|
BundleStreamSource.Event
Modifier and Type | Field and Description |
---|---|
(package private) double |
jitter
Jitter amount.
|
(package private) ExponentialDistribution |
rnd
Random generator.
|
factory
column, meta
source
Constructor and Description |
---|
HistogramJitterFilter(double jitter,
RandomFactory rnd)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected SimpleTypeInformation<V> |
convertedType(SimpleTypeInformation<V> in)
Get the output type from the input type after conversion.
|
protected V |
filterSingleObject(V obj)
Normalize a single instance.
|
protected SimpleTypeInformation<? super V> |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
initializeOutputType
data, getMeta, nextEvent
filter, init
double jitter
ExponentialDistribution rnd
public HistogramJitterFilter(double jitter, RandomFactory rnd)
jitter
- Relative amount of jitter to addrnd
- Random generatorprotected V filterSingleObject(V obj)
AbstractStreamConversionFilter
filterSingleObject
in class AbstractStreamConversionFilter<V extends NumberVector<?>,V extends NumberVector<?>>
obj
- Database object to normalizeprotected SimpleTypeInformation<? super V> getInputTypeRestriction()
AbstractStreamConversionFilter
getInputTypeRestriction
in class AbstractStreamConversionFilter<V extends NumberVector<?>,V extends NumberVector<?>>
protected SimpleTypeInformation<V> convertedType(SimpleTypeInformation<V> in)
AbstractStreamConversionFilter
convertedType
in class AbstractStreamConversionFilter<V extends NumberVector<?>,V extends NumberVector<?>>
in
- input type restriction