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

explain() with lrm() model gives Warning #568

Open
Rosie23 opened this issue Aug 15, 2024 · 1 comment
Open

explain() with lrm() model gives Warning #568

Rosie23 opened this issue Aug 15, 2024 · 1 comment
Labels
invalid ❕ This doesn't seem right, potential bug R 🐳 Related to R

Comments

@Rosie23
Copy link

Rosie23 commented Aug 15, 2024

The code below gives the following warning :

Warning messages:
1: In formula.character(object, env = baseenv()) :
Using formula(x) is deprecated when x is a character vector of length > 1.
Consider formula(paste(x, collapse = " ")) instead.
2: In formula.character(object, env = baseenv()) :
Using formula(x) is deprecated when x is a character vector of length > 1.
Consider formula(paste(x, collapse = " ")) instead.
3: In formula.character(object, env = baseenv()) :
Using formula(x) is deprecated when x is a character vector of length > 1.
Consider formula(paste(x, collapse = " ")) instead.

library("rms")
library(DALEX)
data(titanic_imputed, package="DALEX")

model_titanic_lmr <- lrm(survived ~ class + gender + rcs(age) + sibsp +
                           parch + fare + embarked, titanic_imputed)

explain_titanic_lmr <- explain(model_titanic_lmr, data = titanic_imputed, 
                               y = titanic_imputed$survived, verbose=F,
                               predict_function = function(m,x) 
                                 predict(m, x, type = "fitted"),
                               label = "Logistic regression")
@hbaniecki hbaniecki added R 🐳 Related to R invalid ❕ This doesn't seem right, potential bug labels Aug 16, 2024
@mayer79
Copy link

mayer79 commented Aug 17, 2024

Does not seem to be related to {DALEX}. The following code gives the same warning:

library(rms)

data(titanic_imputed, package ="DALEX")

model_titanic_lmr <- lrm(survived ~ class + gender + rcs(age) + sibsp +
                           parch + fare + embarked, data = titanic_imputed)

predict(model_titanic_lmr, head(titanic_imputed))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid ❕ This doesn't seem right, potential bug R 🐳 Related to R
Projects
None yet
Development

No branches or pull requests

3 participants