LinearDiscriminantClassifier {RSSL} | R Documentation |
Linear Discriminant Classifier
Description
Implementation of the linear discriminant classifier. Classes are modeled as Gaussians with different means but equal covariance matrices. The optimal covariance matrix and means for the classes are found using maximum likelihood, which, in this case, has a closed form solution.
Usage
LinearDiscriminantClassifier(X, y, method = "closedform", prior = NULL,
scale = FALSE, x_center = FALSE)
Arguments
X |
Design matrix, intercept term is added within the function |
y |
Vector or factor with class assignments |
method |
the method to use. Either "closedform" for the fast closed form solution or "ml" for explicit maximum likelihood maximization |
prior |
A matrix with class prior probabilities. If NULL, this will be estimated from the data |
scale |
logical; If TRUE, apply a z-transform to the design matrix X before running the regression |
x_center |
logical; Whether the feature vectors should be centered |
Value
S4 object of class LeastSquaresClassifier with the following slots:
modelform |
weight vector |
prior |
the prior probabilities of the classes |
mean |
the estimates means of the classes |
sigma |
The estimated covariance matrix |
classnames |
a vector with the classnames for each of the classes |
scaling |
scaling object used to transform new observations |
See Also
Other RSSL classifiers:
EMLeastSquaresClassifier
,
EMLinearDiscriminantClassifier
,
GRFClassifier
,
ICLeastSquaresClassifier
,
ICLinearDiscriminantClassifier
,
KernelLeastSquaresClassifier
,
LaplacianKernelLeastSquaresClassifier()
,
LaplacianSVM
,
LeastSquaresClassifier
,
LinearSVM
,
LinearTSVM()
,
LogisticLossClassifier
,
LogisticRegression
,
MCLinearDiscriminantClassifier
,
MCNearestMeanClassifier
,
MCPLDA
,
MajorityClassClassifier
,
NearestMeanClassifier
,
QuadraticDiscriminantClassifier
,
S4VM
,
SVM
,
SelfLearning
,
TSVM
,
USMLeastSquaresClassifier
,
WellSVM
,
svmlin()