plotComparison: Plots comparison between the original and the new balanced...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

It plots a grid of one to one variable comparison, placing the former dataset graphics next to the balanced one, for each pair of attributes.

Usage

1
plotComparison(dataset, anotherDataset, attrs, cols = 2, classAttr = "Class")

Arguments

dataset

A data.frame. The former imbalanced dataset.

anotherDataset

A data.frame. The balanced dataset. dataset and anotherDataset must have the same columns.

attrs

Vector of character. Attributes to compare. The function generates each posible combination of attributes to build the comparison.

cols

Integer. It indicates the number of columns of resulting grid. Must be an even number. By default, 2.

classAttr

character. Indicates the class attribute from dataset. Must exist in it.

Value

Plot of 2D comparison between the variables.

Examples

1
2
3
4
5
6
data(iris0)
set.seed(12345)

rwoSamples <- rwo(iris0, numInstances = 100)
rwoBalanced <- rbind(iris0, rwoSamples)
plotComparison(iris0, rwoBalanced, names(iris0), cols = 2, classAttr = "Class")

imbalance documentation built on April 14, 2020, 6:02 p.m.