ulda: Uncorrelated Linear Discriminant Analysis (ULDA)

View source: R/ulda.R

uldaR Documentation

Uncorrelated Linear Discriminant Analysis (ULDA)

Description

This function performs Uncorrelated Linear Discriminant Analysis (ULDA) on a given dataset. ULDA seeks linear combinations of features that provide maximum class separation while ensuring that the resulting discriminant axes are mutually uncorrelated. It is particularly useful for dimensionality reduction and classification tasks in high-dimensional spaces.

Usage

ulda(X, Y, preproc = center(), mu = 0, tol = 1e-06)

Arguments

X

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

Y

A factor or numeric vector of length n representing class labels for each sample. If numeric, it will be converted to a factor.

preproc

A preprocessing function from the multivarious package, such as center() or scale(), to apply to the data before ULDA. The default is center(), which centers the columns of X.

mu

A regularization parameter (currently unused, but included for extensibility). Default is 0.

tol

A numeric tolerance level. Singular values smaller than tol are considered negligible and discarded. Default is 1e-6.

Details

The procedure for ULDA can be summarized as follows:

  1. Preprocessing: The data X is preprocessed using the specified preproc function.

  2. Class Statistics: Compute class probabilities, class means, and the global mean of the preprocessed data.

  3. Between-Class Scatter: Form a matrix Hb that captures between-class differences weighted by class probabilities.

  4. Total Scatter: Form the total scatter matrix via the centered data Ht.

  5. SVD of Total Scatter: Perform Singular Value Decomposition (SVD) on Ht to capture the most significant directions of variability.

  6. Projection onto Between-Class Structure: Use SVD on a transformed version of Hb to find directions that maximize class separation.

  7. Final Projection: Combine the transformations to yield a projection matrix whose columns are discriminant vectors that are uncorrelated.

  8. Projection of Data: Project the preprocessed data onto these discriminant vectors to get the final scores.

This approach ensures that the resulting discriminants are uncorrelated linear combinations of features.

Value

An object of class discriminant_projector from multivarious, which contains:

  • rotation: The final projection matrix mapping the original feature space to the ULDA space.

  • s: The scores (projected data) of size n x r, where r is the reduced dimension.

  • sdev: The standard deviations of the projected components.

  • labels: The class labels.

  • preproc: The preprocessing object used.

  • classes: A string "ulda" indicating the type of projector.

See Also

prep, eigs_sym, discriminant_projector

Examples

## Not run: 
data(iris)
X <- as.matrix(iris[, 1:4])
Y <- iris[, 5]
res <- ulda(X, Y)

## End(Not run)

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