meandiff: Normalizes matrix values by class.

mean_diffR 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)


aya49/flowGraph documentation built on Feb. 4, 2024, 6:40 p.m.