split.ratio: Split dataset

View source: R/RandomForest_Functions.R

split.ratioR Documentation

Split dataset

Usage

## S3 method for class 'ratio'
split(df, nsets = 10, train.ratio = 0.8, rf.type, vpred)

Arguments

df

Input dataset as dataframe.

nsets

Number of random sets to generate, Default: 10

train.ratio

Proportion of sample assigned to training set. Range from 0 to 1. E.g 0.8 indicates 80

\item

rf.typeOne of: "class" for classification trees or "reg" for regression trees.

\item

vpredName of response variable. Required if rf.type = class.

Outputs nsets*2 number of dataframes. Training sets are labeled train.i and Hold-out/Test sets are labeled hold.i where i ranges from 1 to nsets. Randomly split dataset by some ratio (e.g 80 train:20 test). Repeat several time for n number of sets. Default is 80:20. Written primarily for rf wrapper function.


SarahAsbury/BioDataTools documentation built on Feb. 5, 2024, 4:01 p.m.