Randomsplit

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search

Purpose

Select a subset of samples from a data set randomly.

Synopsis

sel = randomsplit(x, k)

Inputs

  • x = array, or dataset, containing data to select k samples from,
  • k = number of samples to select.

Outputs

  • sel = logical vector of length nsamples, indicating samples which are selected (true = selected). If input x was a dataset object then sel has size (1, nincluded) where nincluded is the number of included samples, and sel indicates which included samples are selected.

Example

>> load arch;
>> sel = randomsplit(arch, 10);
>> arch_subset = arch(sel,:);

See Also

distslct, reducennsamples, splitcaltest, doptimal, stdsslct, kennardstone