Predict method for an object of class "multiflashlight".
Pass additional elements to update the flashlight, typically data
.
# S3 method for class 'multiflashlight'
predict(object, ...)
A named list of prediction vectors.
fit_part <- lm(Sepal.Length ~ Petal.Length, data = iris)
fit_full <- lm(Sepal.Length ~ ., data = iris)
mod_full <- flashlight(model = fit_full, label = "full")
mod_part <- flashlight(model = fit_part, label = "part")
mods <- multiflashlight(list(mod_full, mod_part), data = iris, y = "Sepal.Length")
predict(mods, data = iris[1:5, ])
#> $full
#> 1 2 3 4 5
#> 5.004788 4.756844 4.773097 4.889357 5.054377
#>
#> $part
#> 1 2 3 4 5
#> 4.879095 4.879095 4.838202 4.919987 4.879095
#>