Learn R Programming

mAPKL (version 1.4.2)

sampling: Splits a dataset to a train and a test sets of a user defined percentage

Description

This function takes as input a dataset and splits it into a train and a test set based to a user defined percentage.

Usage

sampling(Data,valPercent,classLabels,seed)

Arguments

Data
The input dataset to be split as an eSet object.
valPercent
The percentage of the input dataset used for validation purposes e.g. 40.
classLabels
The varLabels name in the eSet object where the class labels are stored e.g "type".
seed
Setting the seed number for reproducible sampling. The default value is 1.

Value

  • trainDataThe data used for training as an eSet object
  • testDataThe data used for validation as an eSet object

Examples

Run this code
library(mAPKLData)
data(mAPKLData)
breast <- sampling(Data=mAPKLData, valPercent=40, classLabels="type", seed=135)

Run the code above in your browser using DataLab