Description Usage Arguments Value Examples
Explain difference between predictions from a model
1 | epdiff(mod, x1, x2, d, predictfunc)
|
mod |
Model |
x1 |
Input 1. Single row data frame or matrix. |
x2 |
Input 2. Single row data frame or matrix. |
d |
Max number of input dimensions to use. |
predictfunc |
Func to use to predict. Defaults to 'predict'. |
ggplot object showing effect
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # gbm
m1 <- gbm::gbm(Petal.Width ~ Sepal.Length + Sepal.Width, data=iris, distribution='gaussian')
x1 <- iris[1,]
x2 <- iris[2,]
epdiff(m1, x1, x2)
epdiff(m1, iris[12,], iris[20,])
epdiff(m1, iris[sample(1:nrow(iris), 1),], iris[sample(1:nrow(iris), 1),])
# Linear model
mod_lm <- lm(Petal.Width ~ Sepal.Length + Sepal.Width, data=iris)
epdiff(mod_lm, iris[sample(1:nrow(iris), 1),], iris[sample(1:nrow(iris), 1),])
epdiff(mod_lm, iris[sample(1:nrow(iris), 1),], iris[sample(1:nrow(iris), 1),], d=3)
mod_lm2 <- lm(Petal.Width ~ Petal.Length + Sepal.Width, data=iris)
epdiff(mod_lm2, iris[sample(1:nrow(iris), 1),], iris[sample(1:nrow(iris), 1),])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.