DALEX icon indicating copy to clipboard operation
DALEX copied to clipboard

explain() with lrm() model gives Warning

Open Rosie23 opened this issue 1 year ago • 1 comments

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")

Rosie23 avatar Aug 15 '24 13:08 Rosie23

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))

mayer79 avatar Aug 17 '24 15:08 mayer79