cross_plot | R Documentation |
The cross_plot shows how the input variable is correlated with the target variable, getting the likelihood rates for each input's bin/bucket .
cross_plot(data, input, target, path_out, auto_binning, plot_type = "both")
data |
data frame source |
input |
input variable name (if empty, it runs for all numeric variable), it can take a single character value or a character vector. |
target |
variable name to predict |
path_out |
path directory, if it has a value the plot is saved |
auto_binning |
indicates the automatic binning of input variable based on equal frequency (function 'equal_freq'), default value=TRUE |
plot_type |
indicates if the output is the 'percentual' plot, the 'quantity' or 'both' (default). |
cross plot
## Example 1:
cross_plot(data=heart_disease, input="chest_pain", target="has_heart_disease")
## Example 2: Disabling auto_binning:
cross_plot(data=heart_disease, input="oldpeak",
target="has_heart_disease", auto_binning=FALSE)
## Example 3: Saving the plot into a folder:
#cross_plot(data=heart_disease, input="oldpeak",
# target="has_heart_disease", path_out = "my_folder")
## Example 4: Running with multiple input variables at the same time:
cross_plot(data=heart_disease, input=c("age", "oldpeak", "max_heart_rate"),
target="has_heart_disease")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.