fg_feat_mean_class: Normalizes all features for class.

View source: R/02_flowgraph_features.R

fg_feat_mean_classR Documentation

Normalizes all features for class.

Description

For each class label in column class of meta, fg_feat_mean_class takes the column mean of the rows in the given feature matrices (as specified in node_features and edge_features) associated with that class; it then takes the difference point by point between these means and the original rows for that class.

FUNCTION_DESCRIPTION

Usage

fg_feat_mean_class(
  fg,
  class,
  no_cores = 1,
  node_features = NULL,
  edge_features = NULL
)

Arguments

fg

PARAM_DESCRIPTION

class

a column name in fg_get_meta(fg) indicating the meta data that should be used as the class label of each sample while conudcting normalization.

no_cores

An integer indicating how many cores to parallelize on.

node_features

A string vector indicating the node features to perform normalization on; set as NULL to normalize all.

edge_features

A string vector indicating the edge features to perform normalization on; set as NULL to normalize all.

Details

For all features in the given flowGraph object and for each class label in column class of meta, fg_feat_mean_class. It takes the column mean of the rows in the given feature matrices (as specified in node_features and edge_features) associated with that class; it then takes the difference point by point between these means and the original rows for that class. fg_feat_mean_class

Value

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

flowGraph object with normalized features.

See Also

flowGraph-class

Examples


 no_cores <- 1
 data(fg_data_pos30)
 fg <- flowGraph(fg_data_pos30$count, class=fg_data_pos30$meta$class,
                 prop=FALSE, specenr=FALSE,
                 no_cores=no_cores)

 fg <- fg_feat_mean_class(fg, class="class", node_features="count",
                        no_cores=no_cores)


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