n_dup_max: The function to calculate the maximum round each sampling is...

View source: R/n_dup_max.R

n_dup_maxR Documentation

The function to calculate the maximum round each sampling is repeated

Description

The function to calculate the maximum round each sampling is repeated, if dup_size is given as 0 then, it calculates the maximum round the number of positive instances to be duplicated to nearly match the number of negative instances

Usage

n_dup_max(size_input, size_P, size_N, dup_size = 0)

Arguments

size_input

The size of overall dataset

size_P

The number of positive instances

size_N

The number of negative instances

dup_size

A number or vector of the number of times to be duplicated. The default is zero which means duplicating until nearly balanced.

Value

If dup_size is zero or contains zero, the number of rounds to duplicate positive to nearly equal to the number of negative instances If dup_size is not zero or contains no zero, the maximum value in dup_size

Author(s)

Wacharasak Siriseriwan <wacharasak.s@gmail.com>

Examples

	data_example = sample_generator(10000,ratio = 0.80)
	P = data_example[data_example[,3]=="p",-3]
	N = data_example[data_example[,3]=="n",-3]
	D = rbind(P,N)
	max_round =n_dup_max(nrow(D),nrow(P),nrow(N),dup_size= 0)


smotefamily documentation built on May 29, 2024, 7:54 a.m.