Package moa.streams.filters
Class StandardisationFilter
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.streams.filters.AbstractStreamFilter
-
- moa.streams.filters.StandardisationFilter
-
- All Implemented Interfaces:
Configurable
,Serializable
,CapabilitiesHandler
,MOAObject
,OptionHandler
,ExampleStream
,StreamFilter
public class StandardisationFilter extends AbstractStreamFilter
This filter is to standardise instances in a stream. Z-SCORE is used to standardise the values of a normal distribution. For more information: https://en.wikipedia.org/wiki/Standard_score. The formula is: z=(z-μ)/σ μ is the mean of the population. σ is the standard deviation of the population, as the square root of variance. There are three algorithms for calculating variance. For more information: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Computing_shifted_data 1. Naive algorithm 2. Welford's online algorithm 3. Two-pass algorithm- Author:
- Ethan Wang
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
AlgorithmIndex
MultiChoiceOption
AlgorithmOption
FloatOption
WeightedOptionFloat
-
Fields inherited from class moa.streams.filters.AbstractStreamFilter
inputStream
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description StandardisationFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instance
filterInstance(Instance inst)
void
getDescription(StringBuilder sb, int indent)
Returns a string representation of this object.InstancesHeader
getHeader()
Gets the header of this stream.String
getPurposeString()
Dictionary with option texts and objectsprotected void
restartImpl()
Restarts this filter.-
Methods inherited from class moa.streams.filters.AbstractStreamFilter
estimatedRemainingInstances, hasMoreInstances, isRestartable, nextInstance, prepareForUseImpl, restart, setInputStream
-
Methods inherited from class moa.options.AbstractOptionHandler
copy, getCLICreationString, getOptions, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
-
Methods inherited from class moa.AbstractMOAObject
copy, measureByteSize, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.capabilities.CapabilitiesHandler
getCapabilities
-
Methods inherited from interface moa.streams.ExampleStream
defineImmutableCapabilities
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
-
-
-
Field Detail
-
AlgorithmOption
public MultiChoiceOption AlgorithmOption
-
WeightedOptionFloat
public FloatOption WeightedOptionFloat
-
AlgorithmIndex
protected int AlgorithmIndex
-
-
Method Detail
-
getPurposeString
public String getPurposeString()
Description copied from class:AbstractOptionHandler
Dictionary with option texts and objects- Specified by:
getPurposeString
in interfaceOptionHandler
- Overrides:
getPurposeString
in classAbstractOptionHandler
- Returns:
- the string with the purpose of this object
-
restartImpl
protected void restartImpl()
Description copied from class:AbstractStreamFilter
Restarts this filter. All instances that extends fromAbstractStreamFilter
must implementrestartImpl
.restart
usesrestartImpl
inAbstractStreamFilter
.- Specified by:
restartImpl
in classAbstractStreamFilter
-
getHeader
public InstancesHeader getHeader()
Description copied from interface:ExampleStream
Gets the header of this stream. This is useful to know attributes and classes. InstancesHeader is an extension of weka.Instances.- Returns:
- the header of this stream
-
filterInstance
public Instance filterInstance(Instance inst)
- Specified by:
filterInstance
in interfaceStreamFilter
- Overrides:
filterInstance
in classAbstractStreamFilter
-
getDescription
public void getDescription(StringBuilder sb, int indent)
Description copied from interface:MOAObject
Returns a string representation of this object. Used inAbstractMOAObject.toString
to give a string representation of the object.- Parameters:
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
-