Description Usage Arguments Details Value
View source: R/momentum_prediction.R
Performs the Perceptron Learning Algorithm with weight elimination
1 | regularized_pocket(x, y, weight_elimination, maxit, initial_weights = NULL)
|
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 |
[[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}
perceptron weights (bias, weights) where
y ~ bias + x * weights. Attribute "niter"
holds the iteration count
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.