Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cal_plot error #31

Open
jennjh opened this issue Nov 9, 2023 · 1 comment
Open

cal_plot error #31

jennjh opened this issue Nov 9, 2023 · 1 comment

Comments

@jennjh
Copy link

jennjh commented Nov 9, 2023

Hi,

I am having trouble with cal_plot function after a recent R update.

When I use the below code, I get an error, which I didn't before the R update

cal_plot(fit_preddf,
         outcome = 'fit_obs',
         prediction = 'fit_pred',
         n_bins = 5,show_loess = TRUE)
#> Error in cal_plot(fit_preddf, outcome = "fit_obs", : You must either set n_bins > 0 and show_loess to FALSE or set n_bins to 0 and show_loess to TRUE. Both cannot be displayed."

However, when I change it this, I still get an error.

cal_plot(fit_preddf,
         outcome = 'fit_obs',
         prediction = 'fit_pred',
         n_bins = 5,show_loess = FALSE)
#> Error in cal_plot(fit_preddf, outcome = "fit_obs", : argument "positive" is missing, with no default"

Created on 2023-11-08 with reprex v2.0.2

Any idea why this is happening or have any tips to generating the cal_plot? I am running R 4.3.2.

Thanks!

@jennjh jennjh changed the title cal_plot erro cal_plot error Nov 9, 2023
@timdisher
Copy link

I think this may just be that the documentation hasn't been updated to reflect the new "positive" argument so when you try ?cal_plot you wouldn't know it exists. You can see it's been updated on the actual code side (https://github.com/ML4LHS/runway/blob/master/R/cal_plots.R) including documentation and a new example but the actual help documentation just wasn't updated (https://github.com/ML4LHS/runway/blob/master/man/cal_plot.Rd). I ran into the same issue yesterday @kdpsingh if I'm right I think you just need to run devtools::document() on the stable version and merge back to main.

Using the example in the rendered documentation

library(runway)
data(single_model_dataset)

roc_plot(single_model_dataset, outcome = 'outcomes', prediction = 'predictions', ci = TRUE)
#> Error in roc_plot(single_model_dataset, outcome = "outcomes", prediction = "predictions", : argument "positive" is missing, with no default

Adding the positive argument which just indicates which value indicates the positive class. This is just copying the example from the latest function file.

library(runway)
data(single_model_dataset)

cal_plot(single_model_dataset, outcome = 'outcomes', positive = '1', prediction = 'predictions', n_bins = 5)
#> Warning in ggplot2::geom_point(ggplot2::aes(x = bin_pred, y = bin_prob, :
#> Ignoring unknown aesthetics: ymin and ymax
#> Warning: Removed 2 rows containing missing values (`geom_bar()`).

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants