rhastib: Simulate two-class training and testing data according to...

Description Usage Arguments Value Author(s) Examples

Description

This function simulates training and testing data sets according to a statistical model described by Hastie and Tibshirani in their book

Usage

1
rhastib(n_train = 100, n_test = 100, n_subclass = 10, sigma2 = 0.1)

Arguments

n_train

an integer for the number of training samples.

n_test

an integer for the number of test samples.

n_subclass

an integer for the number of subclass in the Hastie and Tibishirani model.

sigma2

a numeric for the within-group variance in the Hastie and Tibishirani model.

Value

a list with 4 attributes:

$train a matrix with n_train samples

$test a matrix with n_test samples

$class_train a vector of class labels for the train set

$class_test a vector of class labels for the test set

Author(s)

Olivier François

Examples

1
2
3
library(isd)
X <- rhastib(n_train = 100, n_test = 100, n_subclass = 10, sigma2 = .1)
plot(X$train, col = X$class_train, pch = 19)

bcm-uga/isd documentation built on May 15, 2019, 9:02 p.m.