Description Usage Arguments Details Value Examples
A function to split dataset into training and testing data
1 |
dataSet |
a data.frame that representing dataset (m \times n), where m is the number of instances and n is the number of variables where the last column is the output variable. dataSet must have at least two columns and ten rows of data that contain only numbers (integer or float). |
dataTrainRate |
a float number between 0 to 1 representing the training data rate of given dataset. This parameter has default value of 0.5. |
seed |
a integer value for static random. Default value is NULL, which means the function will not do static random. |
This function split dataset into training and testing data. By default,
this function split dataset into 50
dataTest
. You can decide the training data rate by change the
value of dataTrainRate
. Example, if you want to set the training
data rate by 80
As the remaining of dataTrainRate
value, which is 0.2, will be
set as dataTest
rate.
a list contains data.frame of training data and testing data.
1 2 3 4 5 6 7 8 9 10 11 | ##################################
## Splitting Dataset into Training and Testing Data
## load R Package data
data(gradDescentRData)
## get z-factor data
dataSet <- gradDescentRData$CompressilbilityFactor
## split dataset
splitedDataSet <- splitData(dataSet)
#show result
print(splitedDataSet$dataTrain)
print(splitedDataSet$dataTest)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.