Scales or unscales continuous data prior to its use in neural network training, testing, or forecasting.

Namespace: Imsl.DataMining.Neural
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:

z=r(x-\text{realMin})+\text{targetMin},
where
r=\frac{\text{targetMax}-\text{targetMin}}{\text{realMax}-\text{realMin}}.

If 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:


            z=\frac{(x-a)}{b},
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 \tilde{s}, where \tilde{s}
            is a robust estimate of the population standard deviation:

\tilde{s}=\frac{\mbox{MAD}}{0.6745}

where MAD is the Mean Absolute Deviation

\mbox{MAD}=median\{\mid x-median\{x\}\mid\}

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:

x=\frac{(z-\text{targetMin})}{r}+\text{realMin.}

Unbounded z-score Scaling

If scalingMethod is UnboundedZScoreMeanStdev or UnboundedZScoreMedianMAD, then a scaling operation is conducted using the z-score calculation:


            z=\frac{(x-center)}{spread},
If scalingMethod is UnboundedZScoreMeanStdev then Center is set equal to the arithmetic average \bar{x} 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 \tilde{m} 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:

x=spread
            \cdot z+center.

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:

z=\frac{r\cdot
            (x - center)}{spread}-r\cdot \text{realMin}+\text{targetMin.}
If scalingMethod is UnboundedZScoreMeanStdev then Center is set equal to the arithmetic average \bar{x}
            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 \tilde{m} 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:

x=\frac{
            spread\cdot(z-\text{targetMin})}{r}+spread\cdot \text{realMin}+center

Inheritance Hierarchy

System..::.Object
Imsl.DataMining.Neural..::.ScaleFilter

See Also