Extracts response from object of class "flashlight".
response(object, ...)
# Default S3 method
response(object, ...)
# S3 method for class 'flashlight'
response(object, ...)
# S3 method for class 'multiflashlight'
response(object, ...)
A numeric vector of responses.
response(default)
: Default method not implemented yet.
response(flashlight)
: Extract response from flashlight object.
response(multiflashlight)
: Extract responses from multiflashlight object.
fit <- lm(Sepal.Length ~ ., data = iris)
(fl <- flashlight(model = fit, data = iris, y = "Sepal.Length", label = "ols"))
#>
#> Flashlight ols
#>
#> Model: Yes
#> y: Sepal.Length
#> w: No
#> by: No
#> data dim: 150 5
#> metrics: rmse
response(fl)[1:5]
#> [1] 5.1 4.9 4.7 4.6 5.0
response(fl, data = iris[1:5, ])
#> [1] 5.1 4.9 4.7 4.6 5.0
response(fl, data = iris[1:5, ], linkinv = exp)
#> [1] 164.02191 134.28978 109.94717 99.48432 148.41316