smotefamily (version 1.3.1)

n_dup_max: 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)

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

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.

Author

Wacharasak Siriseriwan <wacharasak.s@gmail.com>

Examples

Run this code
	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)

Run the code above in your browser using DataCamp Workspace