View source: R/explore_target.R
| explore_target | R Documentation |
Helps to explore the distribution of target variable in either visual or tabular form.
explore_target(
setup,
type = c("visual", "tabular"),
weighted = TRUE,
exclude_zero = FALSE,
lower_quantile = 0,
upper_quantile = 1,
n_cuts = 20
)
setup |
Setup object. Created at the start of the workflow. Usually piped in from previous step. |
type |
Character scalar. Either |
weighted |
Logical scalar. Whether the distribution should be weighted. |
exclude_zero |
Logical scalar. Whether to exclude records with zero value of target variable. |
lower_quantile |
Numeric scalar. Lower quantile to include in the distribution analysis. |
upper_quantile |
Numeric scalar. Upper quantile to include in the distribution analysis. |
n_cuts |
Integer scalar. Number of cuts in the printed distribution. More cuts means more detailed view. |
Either a ggplot2 chart or vector of values printed to console.
explore_data, explore_corr
require(dplyr) # for the pipe operator
data('sev_train')
setup <- setup(
data_train = sev_train,
target = 'sev',
weight = 'numclaims',
family = 'gamma',
keep_cols = c('pol_nbr', 'exposure', 'premium')
)
explore_target(setup)
explore_target(setup, type = 'tabular')
explore_target(setup, type = 'visual')
explore_target(setup, type = 'tabular', exclude_zero = TRUE)
explore_target(setup, type = 'visual', lower_quantile = 0.05, upper_quantile = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.