Description Usage Arguments Details Value Examples
The method provides main functionality on building GLM models with automatic variables transformation.
The transformations are based on specified single variable responses for selected black-box model.
See details in vignette("xspliner")
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | xspline(object, ...)
model_surrogate_xspliner(object, ...)
## Default S3 method:
xspline(object, lhs = NULL, response = NULL,
predictors = NULL, data = NULL, form = "additive", bare = NULL,
env = parent.frame(), ...)
## S3 method for class 'formula'
xspline(object, model, data = NULL,
consider = "specials", env = parent.frame(), ...)
## S3 method for class 'explainer'
xspline(object, env = parent.frame(), ...)
|
object |
Predictive model, formula or explainer (see DALEX) object. |
... |
Other arguments passed to |
lhs |
Left-hand side of model formula. Can be transformed response. |
response |
Name of response variable of |
predictors |
Predictor values that should be used in final model. |
data |
Training data of |
form |
Can be 'additive' (default) or 'multiplicative'. Specifies formula form in final model. |
bare |
Variable names that mustn't be transformed in final model. |
env |
Environment in which optional variables passed into parameters are stored. variables transformation. See vignette("xspliner") for details. |
model |
When |
consider |
One of |
model_surrogate_xspliner is a wrapper of xspline method to assure consistency with https://github.com/ModelOriented/DrWhy tools
GLM object of class 'xspliner'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # preparing blackbox model
library(randomForest)
rf_iris <- randomForest(
Petal.Width ~ Sepal.Length + Petal.Length + Species,
data = iris)
# formula based xspliner
xs_iris <- xspline(
Petal.Width ~ xs(Sepal.Length) + xs(Petal.Length) + xf(Species),
model = rf_iris)
summary(xs_iris)
plot(xs_iris, "Sepal.Length")
# passing just the model
xs_iris <- xspline(rf_iris)
summary(xs_iris)
plot(xs_iris, "Sepal.Length")
# using DALEX
library(DALEX)
xs_iris_explainer <- explain(rf_iris)
xs_iris <- xspline(rf_iris)
summary(xs_iris)
plot(xs_iris, "Sepal.Length")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.