regularized_pocket: Perform regularized pocket algorithm

Description Usage Arguments Details Value

View source: R/momentum_prediction.R

Description

Performs the Perceptron Learning Algorithm with weight elimination

Usage

1
regularized_pocket(x, y, weight_elimination, maxit, initial_weights = NULL)

Arguments

x

A numeric matrix with n rows. Should NOT include a column of all 1s for bias weight.

y

a numeric vector with n columns

weight_elimination

λ in the description

maxit

the maximum number of iterations

initial_weights

the initial weights. If missing or NULL, uses linear regression

Details

[[sign(w^Tx_n) \neq y_n]] + \frac{λ}{2n}∑_{i=1}^d\frac{w_i^2}{1+w_i^2}

We treat the PLA update as a “derivative" of the first component. So, our update in the ith component will be

PLA_update - \frac{λ}{n}\frac{w_i}{(1+w_i^2)^2}

Value

perceptron weights (bias, weights) where y ~ bias + x * weights. Attribute "niter" holds the iteration count


benSepanski/pfselect documentation built on May 1, 2020, 1:57 p.m.