olda: Orthogonal Linear Discriminant Analysis

View source: R/olda.R

oldaR Documentation

Orthogonal Linear Discriminant Analysis

Description

This function performs Orthogonal Linear Discriminant Analysis (OLDA) on a given dataset. OLDA finds orthogonal linear discriminants that maximize the separation between classes. It is useful for dimensionality reduction and classification tasks.

Usage

olda(X, Y, preproc = pass())

Arguments

X

A numeric matrix where columns represent features and rows represent samples.

Y

A factor or numeric vector representing class labels for each sample.

preproc

A preprocessing function (from multivarious) to apply to the data. Default is pass() (no preprocessing).

Details

The function proceeds through the following steps:

  1. ULDA Projection: The data is first projected using Uncorrelated Linear Discriminant Analysis (ULDA).

  2. QR Decomposition: The projection matrix from ULDA is then orthogonalized using QR decomposition.

  3. Final Projection: The orthogonalized projection matrix is applied to the (preprocessed) data, and a discriminant_projector object is returned.

Value

A discriminant_projector object containing:

  • v : The orthogonal loadings (projection matrix).

  • s : The projected scores.

  • sdev : Standard deviations of the score dimensions.

  • labels: The class labels.

  • preproc: The preprocessing object.

See Also

ulda, qr, qr.Q, discriminant_projector

Examples

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

## End(Not run)


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