LeastSquaresClassifier: Least Squares Classifier

View source: R/LeastSquaresClassifier.R

LeastSquaresClassifierR Documentation

Least Squares Classifier

Description

Classifier that minimizes the quadratic loss or, equivalently, least squares regression applied to a numeric encoding of the class labels as target. Note this method minimizes quadratic loss, not the truncated quadratic loss. Optionally, L2 regularization can be applied by setting the lambda parameter.

Usage

LeastSquaresClassifier(X, y, lambda = 0, intercept = TRUE,
  x_center = FALSE, scale = FALSE, method = "inverse", y_scale = FALSE)

Arguments

X

matrix; Design matrix for labeled data

y

factor or integer vector; Label vector

lambda

Regularization parameter of the l2 penalty

intercept

TRUE if an intercept should be added to the model

x_center

TRUE, whether the dependent variables (features) should be centered

scale

If TRUE, apply a z-transform to the design matrix X before running the regression

method

Method to use for fitting. One of c("inverse","Normal","QR","BFGS")

y_scale

If True scale the target vector

Value

S4 object of class LeastSquaresClassifier with the following slots:

theta

weight vector

classnames

the names of the classes

modelform

formula object of the model used in regression

scaling

a scaling object containing the parameters of the z-transforms applied to the data

See Also

Other RSSL classifiers: EMLeastSquaresClassifier, EMLinearDiscriminantClassifier, GRFClassifier, ICLeastSquaresClassifier, ICLinearDiscriminantClassifier, KernelLeastSquaresClassifier, LaplacianKernelLeastSquaresClassifier(), LaplacianSVM, LinearDiscriminantClassifier, LinearSVM, LinearTSVM(), LogisticLossClassifier, LogisticRegression, MCLinearDiscriminantClassifier, MCNearestMeanClassifier, MCPLDA, MajorityClassClassifier, NearestMeanClassifier, QuadraticDiscriminantClassifier, S4VM, SVM, SelfLearning, TSVM, USMLeastSquaresClassifier, WellSVM, svmlin()


jkrijthe/RSSL documentation built on Jan. 13, 2024, 1:56 a.m.