[docs] Details to performance_roc()#777
Merged
strengejacke merged 11 commits intomainfrom Dec 29, 2024
Merged
Conversation
Member
|
The docs look great (: |
Member
Author
|
why does the |
Member
|
For me, it also fails locally and I couldn't find any mistake? Strange, what have we missed? |
Member
|
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.3766234Created on 2024-12-29 with reprex v2.1.1 |
Member
|
You need to add the S3 method for
|
Member
|
Coo, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is probably a better way to phrase it though (@mattansb?)