-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
[docs] Details to performance_roc() #777
Conversation
The docs look great (: |
why does the |
For me, it also fails locally and I couldn't find any mistake? Strange, what have we missed? |
library(performance)
library(bayestestR)
data(iris)
set.seed(123)
iris$y <- rbinom(nrow(iris), size = 1, .3)
folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE)
test_data <- iris[folds, ]
train_data <- iris[-folds, ]
model <- glm(y ~ Sepal.Length + Sepal.Width, data = train_data, family = "binomial")
x <- performance_roc(model, new_data = test_data)
class(x)
#> [1] "performance_roc" "see_performance_roc" "data.frame"
methods(class = class(x))
#> Warning in .S3methods(generic.function, class, envir, all.names = all.names, :
#> 'class' is of length > 1; only the first element will be used
#> [1] as.numeric plot print
#> see '?methods' for accessing help and source code
as.numeric(x)
#> Error: 'list' object cannot be coerced to type 'double'
performance:::as.numeric.performance_roc(x)
#> [1] 0.3766234 Created on 2024-12-29 with reprex v2.1.1 |
You need to add the S3 method for
|
Coo, thanks! |
There is probably a better way to phrase it though (@mattansb?)