Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

LeastSquaresClassifier

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


RSSL

Implementations of Semi-Supervised Learning Approaches for Classification

v0.9.3
GPL (>= 2)
Authors
Jesse Krijthe [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.