smotefamily (version 1.3.1)

RSLS: Relocating Safe-level SMOTE

Description

Generate synthetic positive instances using Relocating Safe-level SMOTE algorithm. Using the parameter "Safe-Level" to determine the possible location and relocating synthetic instances if there is too close to majority instances.

Usage

RSLS(X, target, K = 5, C = 5, dupSize = 0)

Value

data

A resulting dataset consists of original minority instances, synthetic minority instances and original majority instances with a vector of their respective target class appended at the last column

syn_data

A set of synthetic minority instances with a vector of minority target class appended at the last column

orig_N

A set of original instances whose class is not oversampled with a vector of their target class appended at the last column

orig_P

A set of original instances whose class is oversampled with a vector of their target class appended at the last column

K

The value of parameter K for nearest neighbor process used for generating data

K_all

The value of parameter C for nearest neighbor process used for calculating safe-level

dup_size

The maximum times of synthetic minority instances over original majority instances in the oversampling

outcast

A set of original minority instances which has safe-level equal to zero and is defined as the minority outcast

eps

Unavailable for this method

method

The name of oversampling method used for this generated dataset (RSLS)

Arguments

X

A data frame or matrix of numeric-attributed dataset

target

A vector of a target class attribute corresponding to a dataset X.

K

The number of nearest neighbors during sampling process

C

The number of nearest neighbors during calculating safe-level process

dupSize

The number or vector representing the desired times of synthetic minority instances over the original number of majority instances

Author

Wacharasak Siriseriwan <wacharasak.s@gmail.com>

References

Siriseriwan, W. and Sinapiromsaran, K. The Effective Redistribution for Imbalance Dataset : Relocating Safe-Level SMOTE with Minority Outcast Handling. Chiang Mai Journal of Science. 43(1), 234 - 246.

Examples

Run this code
	library(smotefamily)
	data_example = sample_generator(5000,ratio = 0.80)
    genData = RSLS(data_example[,-3],data_example[,3])
	genData_2 = RSLS(data_example[,-3],data_example[,3],K=7, C=5)


Run the code above in your browser using DataLab