Learn R Programming

MSclassifR (version 0.4.0)

fast_generate_synthetic: Function generating synthetic examples using SMOTE

Description

This function generates synthetic examples using the SMOTE algorithm. For each example in the minority class, this function generates synthetic examples by interpolating between the example and its k nearest neighbors. This function is used in the smote_classif function.

Usage

fast_generate_synthetic(dat, k, n, p_code)

Value

A data frame containing the generated synthetic examples.

Arguments

dat

A data.frame object.

k

Number of nearest neighbors to consider.

n

Number of synthetic examples to generate.

p_code

Numeric code representing the distance metric to use:

  • p >= 1: p-norm

  • p = 0: Chebyshev

  • p = -1: Canberra

  • p = -2: Overlap (nominal attributes only)

  • p = -3: HEOM (Heterogeneous Euclidean-Overlap Metric)

  • p = -4: HVDM (Heterogeneous Value Difference Metric)

See Also

smote_classif