Learn R Programming

funModeling (version 1.1)

cross_plot: Cross-plotting input variable vs. target variable

Description

The cross_plot shows how the input variable is correlated with the target variable, getting the likelihood rates for each input's bin/bucket .

Usage

cross_plot(data, str_input, str_target, path_out, auto_binning)

Arguments

data
data frame source
str_input
string input variable
str_target
string of the variable to predict
path_out
path directory, if it has a value the plot is saved
auto_binning
indicates the automatic binning of str_input variable based on equal frequency (function 'equal_freq'), default value=TRUE

Value

cross plot

Examples

Run this code
## Example 1:
cross_plot(data=heart_disease, str_input="chest_pain", str_target="has_heart_disease")

## Example 2: Disabling auto_binning:
cross_plot(data=heart_disease, str_input="oldpeak",
		str_target="has_heart_disease", auto_binning=FALSE)

## Example 3: Saving the plot into a folder:
cross_plot(data=heart_disease, str_input="oldpeak",
		str_target="has_heart_disease", path_out = "my_folder")

## Example 4: Running with multiple input variables at the same time:
cross_plot(data=heart_disease, str_input=c("age", "oldpeak", "max_heart_rate"),
		str_target="has_heart_disease")

Run the code above in your browser using DataLab