mean_diff {flowGraph}R Documentation

Normalizes matrix values by class.

Description

Used only in the fg_feat_mean_class function; for each class in the classes vector, meandiff takes the column mean of the rows in the given matrix associated with that class; it then takes the difference point by point between these means and the original rows for that class.

Usage

mean_diff(m0, classes)

Arguments

m0

A numeric matrix.

classes

A vector whose length is equal to the number of rows in the given matrix.

Value

A numeric matrix whose dimensions equate to that of the input and whose values are normalized per class.

See Also

fg_feat_mean_class

Examples


 classes <- append(rep('apples',4), rep('oranges',3))
 m0 <- matrix(rnorm(35), nrow=7)
 m <- flowGraph:::mean_diff(m0, classes)


[Package flowGraph version 1.1.0 Index]