allda: Adaptive Local Linear Discriminant Analysis (ALLDA)

View source: R/allda.R

alldaR Documentation

Adaptive Local Linear Discriminant Analysis (ALLDA)

Description

Perform dimensionality reduction using the ALLDA algorithm.

Usage

allda(
  X,
  y,
  ncomp,
  k,
  r = 2,
  preproc = multivarious::center(),
  max_iter = 30,
  tol = 1e-04,
  var_retained = 0.95,
  reg = 1e-05
)

Arguments

X

Data matrix of size n x d (n samples, d features).

y

Label vector of length n.

ncomp

Reduced dimension (must be less than the number of features retained by PCA).

k

Number of neighbors.

r

Parameter r (default is 2, must be > 1).

preproc

A preprocessing step from multivarious. Defaults to centering.

max_iter

Maximum number of iterations (default is 30).

tol

Convergence tolerance (default is 1e-4).

var_retained

Proportion of variance to retain during PCA (default is 0.95).

reg

Regularization term to ensure invertibility of St (default is 1e-5).

Value

An S3 object of class "discriminant_projector" containing the transformation matrix W, the transformed scores, and related metadata.

References

Nie, F., Wang, Z., Wang, R., Wang, Z., & Li, X. (2020). Adaptive local linear discriminant analysis. ACM Transactions on Knowledge Discovery from Data (TKDD), 14(1), 1-19.

Examples

# result <- allda(X, y, ncomp = 2, k = 5)
# W <- result$rotation
# S <- result$S

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