Learn R Programming

cvxbiclustr (version 0.0.1)

get_validation: Select Validation Set for a Matrix

Description

get_validation selects a random sample of matrix indices for regularization parameter selection.

Usage

get_validation(p, n, fraction = 0.1, seed = 12345)

Arguments

p
Number of rows
n
Number of columns
fraction
Fraction of entries for hold out
seed
Seed for random number generator

Examples

Run this code
n <- 5
p <- 4
fraction <- 0.1
Theta <- get_validation(p,n,fraction)

M <- matrix(rnorm(n*p),p,n)
YT <- t(M)
YT[Theta$ThetaV] <- NA
Y <- t(YT)
Theta

Run the code above in your browser using DataLab