naive_glmnet | R Documentation |
Naive glmnet fitting procedure
naive_glmnet( x1, x2, y1, y2, s = "lambda.min", family = "binomial", z1, z2, ... )
x1 |
A data matrix of size n (number of samples) times p (number of features) |
x2 |
A data matrix of size n (number of samples) times p (number of features) |
y1 |
A vector |
y2 |
A vector |
s |
Default to "lambda.min" |
family |
family of glmnet |
z1 |
(Deprecated) a data matrix, columns are pairwise-differences between the original data columns. |
z2 |
(Deprecated) a data matrix, columns are pairwise-differences between the original data columns. |
... |
Extra parameter settings for cv.glmnet |
A vector
data(cpop_data_binary, package = 'CPOP') ## Loading simulated matrices and vectors x1 = cpop_data_binary$x1 x2 = cpop_data_binary$x2 y1 = cpop_data_binary$y1 y2 = cpop_data_binary$y2 set.seed(1) cpop_result = cpop_model(x1 = x1, x2 = x2, y1 = y1, y2 = y2, alpha = 1, n_features = 10) lasso_result = naive_glmnet(x1 = x1, x2 = x2, y1 = y1, y2 = y2, alpha = 1, intercept = FALSE) cpop_result lasso_result plot_cpop(cpop_result) plot_cpop(lasso_result) z1 = pairwise_col_diff(x1) z2 = pairwise_col_diff(x2) plot(predict_cpop(cpop_result, newz = z1)$cpop_model_avg, predict_naive_glmnet(lasso_result, newz = z1)$naive_glmnet_avg) abline(a = 0, b = 1, col = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.