naive_glmnet: Naive glmnet fitting procedure

View source: R/naive_glmnet.R

naive_glmnetR Documentation

Naive glmnet fitting procedure

Description

Naive glmnet fitting procedure

Usage

naive_glmnet(
  x1,
  x2,
  y1,
  y2,
  s = "lambda.min",
  family = "binomial",
  z1,
  z2,
  ...
)

Arguments

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

Value

A vector

Examples

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")

kevinwang09/top documentation built on April 20, 2022, 3:01 a.m.