ModelOriented / ModelOriented/DALEX

explain() with lrm() model gives Warning

Open
#568 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

invalid ❕ R 🐳
Dominant language
Python
Stars
1.5k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported titanic_imputed example with rms::lrm() and DALEX::explain(), then inspect the explain() path that handles the supplied model and predict_function. Done means the example no longer emits the deprecated formula.character warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.