predict_cpop: Prediction function for CPOP

View source: R/predict_cpop.R

predict_cpopR Documentation

Prediction function for CPOP

Description

Prediction function for CPOP

Usage

predict_cpop(cpop_result, newx, s = "lambda.min", newz)

Arguments

cpop_result

cpop_model result

newx

New data, n times p, as original features,

s

CV-Lasso lambda

newz

(Deprecated) new data, n times choose(p, 2), as ratio features.

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
x3 = cpop_data_binary$x3
y1 = cpop_data_binary$y1
y2 = cpop_data_binary$y2
y3 = cpop_data_binary$y3
set.seed(1)
cpop_result = cpop_model(x1 = x1, x2 = x2, y1 = y1, y2 = y2, alpha = 0.1, n_features = 10)
cpop_result
head(predict_cpop(cpop_result, newx = x3))

kevinwang09/CPOP documentation built on April 23, 2022, 11:05 a.m.