group_means: Compute Group Means

View source: R/fast_olda.R

group_meansR Documentation

Compute Group Means

Description

Compute the group-wise mean vectors for a given data matrix.

Usage

group_means(Y, X)

Arguments

Y

A factor indicating group membership for each row of X.

X

A matrix (n x d), where n is the number of samples and d is the number of features.

Details

Given a data matrix X and a factor Y, this function computes the mean of the rows of X for each level of Y.

Value

A matrix of group means, where the number of rows equals the number of groups, and each row is the mean vector for that group.


bbuchsbaum/discursive documentation built on April 14, 2025, 4:57 p.m.