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

[BUG] plot.ROC() and plot.prROC() are missing lines when panels = FALSE #9

Closed
serkor1 opened this issue Dec 4, 2024 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@serkor1
Copy link
Owner

serkor1 commented Dec 4, 2024

issue

When plotting ROC- or prROC-classes with plot(x, panels = FALSE), the lines appear in the legend but not on the plot itself.

reprex

rm(list = ls())
library(SLmetrics)
#> Loading {SLmetrics} v0.1.0

# 1) recode Iris
# to binary classification
# problem
#
# Has to adhere
iris$Species <- factor(
  x = as.numeric(
    iris$Species == "virginica"
  )
)

# 2) fit the logistic
# regression
model <- glm(
  formula = Species ~ Sepal.Length + Sepal.Width,
  data    = iris,
  family = binomial(
    link = "logit"
  )
)

# 3) generate predicted
# classes
response <- predict(model, type = "response")

# 4) generate reciever
# operator characteristics
roc <- ROC(
  actual   = iris$Species,
  response = response
)


# 5) plot by species
# im panels
plot(roc)

# 6) plot by species
# in one
plot(roc, panels = FALSE)

Created on 2024-12-04 with reprex v2.1.1

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.2 (2024-10-31)
#>  os       Zorin OS 17.2
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language en_US:en
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Europe/Copenhagen
#>  date     2024-12-04
#>  pandoc   2.9.2.1 @ /usr/bin/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version  date (UTC) lib source
#>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.2)
#>  curl          6.0.1    2024-11-14 [1] CRAN (R 4.4.2)
#>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.2)
#>  evaluate      1.0.1    2024-10-10 [1] CRAN (R 4.4.2)
#>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.2)
#>  fs            1.6.5    2024-10-30 [1] CRAN (R 4.4.2)
#>  glue          1.8.0    2024-09-30 [1] CRAN (R 4.4.2)
#>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.2)
#>  knitr         1.49     2024-11-08 [1] CRAN (R 4.4.2)
#>  lattice       0.22-6   2024-03-20 [1] CRAN (R 4.4.2)
#>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.2)
#>  Rcpp          1.0.13-1 2024-11-02 [1] CRAN (R 4.4.2)
#>  reprex        2.1.1    2024-07-06 [1] CRAN (R 4.4.2)
#>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.2)
#>  rmarkdown     2.29     2024-11-04 [1] CRAN (R 4.4.2)
#>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.2)
#>  SLmetrics   * 0.1-0    2024-12-02 [1] local
#>  withr         3.0.2    2024-10-28 [1] CRAN (R 4.4.2)
#>  xfun          0.49     2024-10-31 [1] CRAN (R 4.4.2)
#>  xml2          1.3.6    2023-12-04 [1] CRAN (R 4.4.2)
#>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.2)
#> 
#>  [1] /usr/local/lib/R/site-library
#>  [2] /usr/lib/R/site-library
#>  [3] /usr/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────
@serkor1 serkor1 added the bug Something isn't working label Dec 4, 2024
@serkor1 serkor1 self-assigned this Dec 4, 2024
@serkor1 serkor1 closed this as completed Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant