train_test_balance: Balance and split the dataset

View source: R/train_test_balance.R

train_test_balanceR Documentation

Balance and split the dataset

Description

Balance and split the dataset

Usage

train_test_balance(
  data,
  y,
  balance = TRUE,
  fractions = c(0.6, 0.2, 0.2),
  seed = NULL,
  verbose = FALSE
)

Arguments

data

A data source, that is one of the major R formats: data.table, data.frame, matrix and so on.

y

A string that indicates a target column name.

balance

A logical value, determines if we want to balance the dataset.

fractions

A vector with 3 numeric values that sum to 1 which determine sizes of train, test and validation datasets. DEFAULT: c(0.6, 0.2, 0.2).

seed

An integer random seed. It allows for comparable results. If it is NULL, the split is random.

verbose

A logical value, if set to TRUE, provides all information about the process, if FALSE gives none.

Value

A list of train, test and validation datasets.


ModelOriented/forester documentation built on June 6, 2024, 7:29 a.m.