generate_sparse: Sparse random projection matrix

View source: R/rp_classes.R

generate_sparseR Documentation

Sparse random projection matrix

Description

Sparse random projection matrix

Usage

generate_sparse(rp, m, included_vector, x = NULL, y = NULL)

Arguments

rp

object of class 'randomprojection'

m

goal dimension, which will be randomly sampled in the SPAR algorithm

included_vector

integer vector of column indices for the variables to be included in the random projection. These indices are produced in the screening step of the SPAR algorithm.

x

matrix of predictors

y

vector of response variable

Value

(possibly sparse) matrix with m rows and length(included_vector) columns.


spareg documentation built on Aug. 8, 2025, 6:46 p.m.