ridge_regression | R Documentation |
Performs a Ridge regression.
ridge_regression(data, response, w=NULL, method="manhattan", type="gaussian")
data |
A biosensor object. |
response |
The name of the scalar response. The response must be a column name in data$variables. |
w |
A weight function. |
method |
The distance measure to be used (@seealso parallelDist::parDist). By default manhattan distance. |
type |
The kernel type ("gaussian" or "lapla"). By default gaussian distance. |
An object containing the components:
best_alphas
Best coefficients obtained with leave-one-out cross-validation criteria.
best_kernel
The kernel matrix of the best solution.
best_sigma
The sigma parameter of the best solution.
best_lambda
The lambda parameter of the best solution.
sigmas
The sigma parameters used in the fitting according to the median heuristic fitting criteria.
predictions
A matrix of predictions.
r2
R-square of the different models fitted.
error
Mean squared-error of the different models fitted.
predictions_cross
A matrix of predictions obtained with leave-one-out cross-validation criteria.
# Data extracted from the paper: Hall, H., Perelman, D., Breschi, A., Limcaoco, P., Kellogg, R., # McLaughlin, T., Snyder, M., Glucotypes reveal new patterns of glucose dysregulation, PLoS # biology 16(7), 2018. file1 = system.file("extdata", "data_1.csv", package = "biosensors.usc") file2 = system.file("extdata", "variables_1.csv", package = "biosensors.usc") data = load_data(file1, file2) regm = ridge_regression(data, "BMI")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.