compare_plot: Comparison plot of train set and test set

View source: R/split.R

compare_plotR Documentation

Comparison plot of train set and test set

Description

Plot compare information of the train set and test set included in the "split_df" class.

Usage

compare_plot(.data, ...)

Arguments

.data

an object of class "split_df", usually, a result of a call to split_df().

...

one or more unquoted expressions separated by commas. Select the variable you want to plotting. You can treat variable names like they are positions. Positive values select variables; negative values to drop variables. If the first expression is negative, compare_target_category() will automatically start with all variables. These arguments are automatically quoted and evaluated in a context where column names represent column positions. They support unquoting and splicing.

Details

The numerical variables are density plots and the categorical variables are mosaic plots to compare the distribution of train sets and test sets.

Value

There is no return value. Draw only the plot.

Examples

library(dplyr)

# Credit Card Default Data
head(ISLR::Default)

# Generate data for the example
sb <- ISLR::Default %>%
  split_by(default)

sb %>%
  compare_plot("income")

sb %>%
  compare_plot()

alookr documentation built on May 29, 2024, 10:38 a.m.