Learn R Programming

OptimClassifier (version 0.1.5)

sampler: Splitting your dataset in training and testing

Description

A training/test partition are created by sampler function.

Usage

sampler(data, p, seed = NULL)

Arguments

data

Data frame from which all variables

p

The percentage of data that goes to training, It can be expressed in either decimal fraction (such as 0.7) or percent (such as 72.12).

seed

a single value, interpreted as an integer, or NULL. The default value is NULL, but for future checks of the model or models generated it is advisable to set a random seed to be able to reproduce it.

Examples

Run this code
# NOT RUN {
if(interactive()){
# The best way to demostrate the functionality is test the function


Sampling <- sampler(AustralianCredit,p=0.7)

}


# }

Run the code above in your browser using DataLab