plotComparison {imbalance}R Documentation

Plots comparison between the original and the new balanced dataset.

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

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

data(iris0)
set.seed(12345)

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


[Package imbalance version 1.0.2.1 Index]