splitSample: splitSample

View source: R/splitSample.R

splitSampleR Documentation

splitSample

Description

Splits a data vector or matrix into training and test data. The size of the partitions is defined by the given percentage.

Usage

splitSample(Data, Percentage)

Arguments

Data

[1:n,1:d] Matrix of n cases and d features, or n d-dimensional datapoints

Percentage

Scalar, value between 1 and 99

Value

trainData

Numeric vector, containing the Data entries in the Train split

testData

Numeric vector, containing the Data entries in the Test split

trainInd

Numeric vector, containing the indices of the the Data entries in the Train split

testInd

Numeric vector, containing the indices of the the Cls entries in the Test split

Author(s)

Michael Thrun

Examples

data("USelectionPoll")
V=splitSample(USelectionPoll$Data,Percentage=50)

Mthrun/Classifiers documentation built on June 28, 2023, 9:28 a.m.