Generates a plot showing the distribution of predicted probabilities. Offers options to show as a histogram or density plot.
Arguments
- dx_obj
A
dx
object- plot_type
Character string specifying the type of plot: "histogram" or "density".
- bins
Optional; number of bins for the histogram (relevant if plot_type = "histogram").
- fill_color
Color to fill the bars or density plot.
Examples
dx_obj <- dx(
data = dx_heart_failure,
true_varname = "truth",
pred_varname = "predicted",
outcome_label = "Heart Attack",
setthreshold = .3
)
dx_plot_probabilities(dx_obj, plot_type = "histogram", bins = 30)
dx_plot_probabilities(dx_obj, plot_type = "density")