Description Usage Arguments Value Examples
View source: R/logreg.ridge.fit.R
This function takes y,x and lambda to perform a logistic regression w/wo l2 penalty The input data should be a numeric matrix without factoer level, though we can use the transform method to encode it. This function will return a list including coefficients of estimates, yhat, and predicted class, and classification error
1 2 3 4 5 6 7 8 | logreg.ridge.fit(
y,
X,
lambda,
epochs = 10,
tol = 1e-05,
beta0 = rep(0, dim(X)[2])
)
|
y |
input y, this is the label of the class, it should be a vector of either zero or one |
X |
input X, this is a matrix of training X. |
lambda |
the coefficient of how severe the penalty should be |
epochs |
this value specifies how much iteration will we do to update our coefficients |
tol |
this input means tolerance, which determines early stop in training |
beta0 |
this is the initialization of beta estimators, sometimes user may want to further train a specific beta, and they can use it as input. |
it will return a list of estimated coefficients, the predicted score y.hat, the predicted class yhat and classification error.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.