Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0
Syntax
C# |
---|
[SerializableAttribute] public class ScaleFilter |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Class ScaleFilter |
Visual C++ |
---|
[SerializableAttribute] public ref class ScaleFilter |
Remarks
Bounded scaling is used to ensure that the values in the scaled array fall between a lower and upper bound. The scale limits have the following interpretation:
Argument | Interpretation |
---|---|
realMin | The lowest value expected in x. |
realMax | The largest value expected in x. |
targetMin | The lower bound for the values in the scaled data. |
targetMax | The upper bound for the values in the scaled data. |
The scale limits are set using the method SetBounds.
The specific scaling used is controlled by the argument scalingMethod used when constructing the filter object. If scalingMethod is ScalingMethod.None, then no scaling is performed on the data.
If the input parameter scalingMethod is ScaleMethod.Bounded then the bounded method of scaling and unscaling is applied to x. The scaling operation is conducted using the scale limits set in method SetBounds, using the following calculation:
whereIf scalingMethod is one of UnboundedZScoreMeanStdev, UnboundedZScoreMedianMAD, BoundedZScoreMeanStdev, or BoundedZScoreMedianMAD, then the z-score method of scaling is used. These calculations are based upon the following scaling calculation:
where a is a measure of center for x, and b is a measure of the spread of x.If scalingMethod is UnboundedZScoreMeanStdev, or BoundedZScoreMeanStdev, then a and b are the arithmetic average and sample standard deviation of the training data.
If scalingMethod is UnboundedZScoreMedianMAD or BoundedZScoreMedianMAD, then a and b are the median and , where is a robust estimate of the population standard deviation:
where MAD is the Mean Absolute Deviation
The Mean Absolute Deviation is a robust measure of spread calculated by finding the median of the absolute value of differences between each non-missing value for the i-th variable and the median of those values.
If the method Decode is called then an unscaling operation is conducted by inverting using:
Unbounded z-score Scaling
If scalingMethod is UnboundedZScoreMeanStdev or UnboundedZScoreMedianMAD, then a scaling operation is conducted using the z-score calculation:
If scalingMethod is UnboundedZScoreMeanStdev then Center is set equal to the arithmetic average of x, and Spread is set equal to the sample standard deviation of x. If scalingMethod is UnboundedZScoreMedianMAD then Center is set equal to the median of x, and Spread is set equal to the Mean Absolute Difference (MAD).The method Decode can be used to unfilter data using the inverse calculation for the above equation:
Bounded z-score Scaling
This method is essentially the same as the z-score calculation described above with additional scaling or unscaling using the scale limits set in method SetBounds. The scaling operation is conducted using the well known z-score calculation:
If scalingMethod is UnboundedZScoreMeanStdev then Center is set equal to the arithmetic average of x, and Spread is set equal to the sample standard deviation of x. If scalingMethod is UnboundedZScoreMedianMAD then Center is set equal to the median of x, and Spread is set equal to the Mean Absolute Difference (MAD).The method Decode can be used to unfilter data using the inverse calculation for the above equation: