Learn R Programming

sambia (version 0.1.0)

smoteNew: smoteNew is a necessary function that modifies the SMOTE algorithm.

Description

smoteNewis a necessary function that modifies the SMOTE algorithm in the following ways: (1) correct bug in original smotefamily::SMOTE() function and (2) lets the user specifiy which class to be oversampled.

Usage

smoteNew(data.x, data.y, K, dup_size = 0, class.to.oversample)

Arguments

data.x

A data frame or matrix of numeric-attributed dataset

data.y

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

K

The number of nearest neighbors during sampling process

dup_size

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

class.to.oversample

Class to be oversampled

Examples

Run this code
# NOT RUN {
library(smotefamily)
library(sambia)
data.example = sample_generator(10000,ratio = 0.80)
genData = sambia:::smoteNew(data.example[,-3],data.example[,3],K = 5,class.to.oversample = 'p')
# }

Run the code above in your browser using DataLab