olda | R Documentation |
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.
olda(X, Y, preproc = pass())
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 |
The function proceeds through the following steps:
ULDA Projection: The data is first projected using Uncorrelated Linear Discriminant Analysis (ULDA).
QR Decomposition: The projection matrix from ULDA is then orthogonalized using QR decomposition.
Final Projection: The orthogonalized projection matrix is applied to the (preprocessed) data,
and a discriminant_projector
object is returned.
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.
ulda
, qr
, qr.Q
, discriminant_projector
## Not run:
data(iris)
X <- as.matrix(iris[, 1:4])
Y <- iris[, 5]
res <- olda(X, Y)
print(res)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.