FeatureSet method: meansub

FeatureSet method: meansub

Syntax: <feature set> meansub <feature> <source> [optional flags]

Example1: fs meansub FEATnorm FEAT -a 2

This method works only on FMatrix features. The mean will be subtracted and the coefficients divided by <a> times the standard deviation. In the example above the new feature FEATnorm has then a mean of {0 0 ...} and the new deviation is {0.5 0.5 ...}.

Example2: fs meansub FEATnorm FEAT -mean {1.0 1.0 1.0 1.0 1.0}

Here a user defined mean vector will be subtracted but no normalization will be done. In the same way a normalization can be done with -dev or both things can be done by using both flags. Of course the dimension of the user defined vectors must be choosen equal to the dimension of the source feature.

Instead of -dev a vector with the mean of the squared values can be choosen with -smean but only when -mean is also used. The deviation is then calculated by:

dev = sqrt(smean - mean^2).

Example3: fs meansub FEATnorm FEAT -upMean vecFEATmean -upSMean vecFEATsmean

By using the flags -upMean and -upSMean you can accumulate the mean values and the mean of the squared values in FVector objects for later use. You can reinit the FVector objects by setting their count to 0:

vecFEATmean configure -count 0

The flags have no effect if either -mean or -dev are used. -upSMean has only an effect if it is used together with -upMean. Which mean and deviation vector will used on the source feature can be set with the -useup flag. Default is to use the updated mean (and deviation).

Optional flags:

-a <a>
see example1
-mean <vector>
user defined mean vector: <vector> can be a vector definition like {0.1 0.2 ..} or a name of a FVector object. The definition can also be read from a file. Then <vector> must be: @filename.
-dev <vector>
user defined deviation vector: similar to -mean.
-smean <vector>
user defined mean of squares vector: can be used instead of -dev. No effect if -dev is also used.
-upMean <FVector object>
This must be an FVector object because it will be updated with the weighted sum of itself and the mean vector of the source feature.
-upSMean <FVector object>
Similar to upMean. Here the mean of the squared values is updated.
-useup <switch>
If <switch> is 0 the current mean and deviation vectors are taken for subtraction and normalization. However the updating (see above) is done. If <switch> is anything other than 0 the already updated vectors are taken.
Related commands: offset


maier@ira.uka.de