DALEX icon indicating copy to clipboard operation
DALEX copied to clipboard

plot.model_performance {DALEX} gives a warning related to the size of element_line() related to ggplot2

Open ManuelSpinola opened this issue 3 months ago • 7 comments

When trying to plot a model performance I get the following warning and the line is not displayed:

Warning: The size argument of element_line() is deprecated as of ggplot2 3.4.0. ℹ Please use the linewidth argument instead. ℹ The deprecated feature was likely used in the DALEX package. Please report the issue at https://github.com/ModelOriented/DALEX/issues. This warning is displayed once every 8 hours. Call lifecycle::last_lifecycle_warnings() to see where this warning was generated.

ManuelSpinola avatar Oct 10 '25 14:10 ManuelSpinola

Can you please provide a minimal reproducible example?

mayer79 avatar Oct 10 '25 15:10 mayer79

library("ranger") titanic_ranger_model <- ranger(survived~., data = titanic_imputed, num.trees = 50, probability = TRUE) explainer_ranger <- explain(titanic_ranger_model, data = titanic_imputed[,-8], y = titanic_imputed$survived) mp_ranger <- model_performance(explainer_ranger) plot(mp_ranger)

ManuelSpinola avatar Oct 10 '25 15:10 ManuelSpinola

Running this code with the current CRAN version 2.5.2 does not seem to give a warning.

mayer79 avatar Oct 10 '25 16:10 mayer79

That’s strange — I’m running DALEX version 2.5.2 in R 4.5.1 on macOS (Tahoe 26.0.1, arm64).

ManuelSpinola avatar Oct 10 '25 16:10 ManuelSpinola

However, the warning itself is not my main concern. The actual issue is that: • The line in the plot(model_performance_object) output is not displayed. • In addition, the whiskers of the boxplot in the feature importance plot (plot(feature_importance)) are not visible.

And I am using ggplot2 4.0.0

ManuelSpinola avatar Oct 10 '25 16:10 ManuelSpinola

With ggplot2 4, I can reproduce the issue.

mayer79 avatar Oct 10 '25 16:10 mayer79

Thanks for confirming — it does look like this is a ggplot2 v4 compatibility issue.

ManuelSpinola avatar Oct 10 '25 17:10 ManuelSpinola