Skip to contents

This function randomly generate B subsamples of size nn and returns the proportion of times that a subsample is linearly separable.

Usage

separable_proportion(X, Y, nn, B = 10)

Arguments

X

Covariate matrix. Each row in X is one observation.

Y

Response vector of \(+1\) and \(-1\) representing the two classes. Y has the same length as the number of rows in X.

nn

Number of observations in each subsample.

B

Numeric. Number of subsamples.

Value

Numeric. The proportion of separable subsamples.

Examples

if (FALSE) {
n <- 1000; p <- 400
X <- matrix(rnorm(n*p, 0, 1), n, p)
Y <- 2 * rbinom(n, 1, 0.5) - 1
separable_proportion(X, Y, nn = 600, B = 10)
}