train_test_balanced_split: Train and Test Balanced Split

Description Usage Arguments Examples

Description

This function allows you to separate your data set in a balanced manner as train and test.

Usage

1
2
train_test_balanced_split(data, default_flag, balance_count,
  seed_value = 1, ratio)

Arguments

data

A data set needs to be specified.

default_flag

The default flag need to specified as string.

balance_count

Desired number of good ar bad observations need to specified.

seed_value

A seed value need to be specified for replicability.

ratio

The percentage of train data should be specified.

Examples

1
2
3
4
5
default_f <- c('1','0','0', '1','1','0','0','1','1')
birth_year <- c(1980, 1985, 1971,1971,1985,1971,1980,1980,1985)
PD <- c(0.1,0.12, 0.2, 0.23, 0.28,0.33,0.39,0.45, O.54)
example_data <- data.frame(default_f,birth_year,PD)
train_test_balanced_split(example_data,default_flag ="default_f", balance_count = 2,seed_value = 1, ratio = 0.90 )

ayhandis/creditR documentation built on May 9, 2019, 8:41 a.m.