splitSample | R Documentation |
Splits a data vector or matrix into training and test data. The size of the partitions is defined by the given percentage.
splitSample(Data, Percentage)
Data |
[1:n,1:d] Matrix of n cases and d features, or n d-dimensional datapoints |
Percentage |
Scalar, value between 1 and 99 |
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 |
Michael Thrun
data("USelectionPoll")
V=splitSample(USelectionPoll$Data,Percentage=50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.