Description Usage Arguments Value Examples
View source: R/plot_lift_curve.R
Buckets data into groups using predicted value (see prep_num_bin
) and finds average predictions and actual in each bucket.
Note: Predictions should be annualised (independent of exposure)
1 2 3 4 5 6 7 8 9 10 11 12 |
actual |
Array[Numeric] - Values we are aiming to predict. |
predicted |
Array[Numeric] - Values that we have predicted. |
weight |
Optional: Array[Numeric] - Weighting of predictions. If NULL even weighting is used |
title |
Optional: String - Title for the plot |
n_bins |
numeric - Number of bins to split exposure into |
method |
string - One of |
use_labels |
logical - should the bins be numbered or human readable labelled |
mean |
numeric - Only used when |
sd |
numeric - Only used when |
use_plotly |
Optional: boolean - If TRUE plotly object is returned else ggplot2 object |
plotly/ggplot object of showing lift curve for given predictions
1 2 | plot_lift_curve(actual=1:100, predicted = 1:100 + rnorm(100, mean=0, sd = 10), title="Example Lift Curve")
plot_lift_curve(actual=1:100, predicted = 1:100 + rnorm(100, mean=0, sd = 10), title="Example Lift Curve", method="gaussian_weight")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.