diff --git a/authors.html b/authors.html index cfc5684..eb2d405 100644 --- a/authors.html +++ b/authors.html @@ -75,14 +75,14 @@
Mayer M (2024). hstats: Interaction Statistics. -R package version 1.2.0, https://mayer79.github.io/hstats, https://github.com/ModelOriented/hstats. +R package version 1.2.0, https://modeloriented.github.io/hstats/, https://github.com/ModelOriented/hstats/.
@Manual{, title = {hstats: Interaction Statistics}, author = {Michael Mayer}, year = {2024}, - note = {R package version 1.2.0, https://mayer79.github.io/hstats}, - url = {https://github.com/ModelOriented/hstats}, + note = {R package version 1.2.0, https://modeloriented.github.io/hstats/}, + url = {https://github.com/ModelOriented/hstats/}, }diff --git a/index.html b/index.html index 984a64a..b775509 100644 --- a/index.html +++ b/index.html @@ -166,7 +166,7 @@
-library(hstats)
+library(hstats)
library(ggplot2)
library(xgboost)
library(shapviz)
@@ -251,7 +251,8 @@ Describe interaction
-plot(partial_dep(fit, v = "age", X = X_train, BY = "log_ocean"), show_points = FALSE)
partial_dep(fit, v = "age", X = X_train, BY = "log_ocean") |>
+ plot(show_points = FALSE)
pd <- partial_dep(fit, v = c("age", "log_ocean"), X = X_train, grid_size = 1000)
@@ -259,8 +260,8 @@ Describe interactionplot(pd, d2_geom = "line", show_points = FALSE)
ice(fit, v = "age", X = X_train, BY = "log_ocean") |>
+ plot(center = TRUE)
-plot(pd_importance(s))
+pd_importance(s) |>
+ plot()
# Compared with four times repeated permutation importance regarding MSE
set.seed(10)
-plot(perm_importance(fit, X = X_valid, y = y_valid))
Permutation importance returns the same order in this case:
@@ -283,7 +287,7 @@The main functions work smoothly on DALEX explainers:
-library(hstats)
+library(hstats)
library(DALEX)
library(ranger)
@@ -296,14 +300,17 @@ DALEX
s # 0.054
plot(s)
-# Strongest relative interaction
-plot(ice(ex, v = "Sepal.Width", BY = "Petal.Width"), center = TRUE)
-plot(partial_dep(ex, v = "Sepal.Width", BY = "Petal.Width"), show_points = FALSE)
-plot(partial_dep(ex, v = c("Sepal.Width", "Petal.Width"), grid_size = 200))
+# Strongest relative interaction (different visualizations)
+ice(ex, v = "Sepal.Width", BY = "Petal.Width") |>
+ plot(center = TRUE)
+
+partial_dep(ex, v = "Sepal.Width", BY = "Petal.Width") |>
+ plot(show_points = FALSE)
-perm_importance(ex)
+partial_dep(ex, v = c("Sepal.Width", "Petal.Width"), grid_size = 200) |>
+ plot()
-# Permutation importance
+perm_importance(ex)
# Petal.Length Petal.Width Sepal.Width Species
# 0.59836442 0.11625137 0.07966910 0.03982554
-library(hstats)
+library(hstats)
ix <- c(1:40, 51:90, 101:140)
train <- iris[ix, ]
@@ -380,7 +387,7 @@ LightGBMaverage_loss(fit, X = X_valid, y = y_valid, loss = "mlogloss")
perm_importance(fit, X = X_valid, y = y_valid, loss = "mlogloss", m_rep = 100)
-# Permutation importance regarding mlogloss
+
# Petal.Length Petal.Width Sepal.Width Sepal.Length
# 2.624241332 1.011168660 0.082477177 0.009757393
@@ -456,7 +463,7 @@ Meta-learning packagestidymodels
-library(hstats)
+library(hstats)
library(tidymodels)
set.seed(1)
@@ -476,7 +483,9 @@ tidymodelss <- hstats(fit, X = iris[, -1])
s # 0 -> no interactions
-plot(partial_dep(fit, v = "Petal.Width", X = iris))
+
+partial_dep(fit, v = "Petal.Width", X = iris) |>
+ plot()
imp <- perm_importance(fit, X = iris, y = "Sepal.Length")
imp
@@ -490,7 +499,7 @@ tidymodelscaret
-library(hstats)
+library(hstats)
library(caret)
set.seed(1)
@@ -505,14 +514,17 @@ caret
h2(hstats(fit, X = iris[, -1])) # 0
-plot(ice(fit, v = "Petal.Width", X = iris), center = TRUE)
-plot(perm_importance(fit, X = iris, y = "Sepal.Length"))
+ice(fit, v = "Petal.Width", X = iris) |>
+ plot(center = TRUE)
+
+perm_importance(fit, X = iris, y = "Sepal.Length") |>
+ plot()
d2_geom = "line"
. Instead of a heatmap of the two features, one of the features is moved to color grouping. Combined with swap_dim = TRUE
, you can swap the role of the two v
variables without recalculating anything. The idea was proposed by Roel Verbelen in issue #91, see also issue #94.d2_geom = "line"
. Instead of a heatmap of the two features, one of the features is moved to color grouping. Combined with swap_dim = TRUE
, you can swap the role of the two v
variables without recalculating anything. The idea was proposed by Roel Verbelen in issue #91, see also issue #94.BY
and w
via column names would fail for tibbles. This problem was described in #92 by Roel Verbelen. Thx!BY
and w
via column names would fail for tibbles. This problem was described in #92 by Roel Verbelen. Thx!perm_importance()
and average_loss()
).