Prediction for a large dataset can create a vector too large to retain in memory. A sink is a user-supplied function that receives one block of results at a time, for example to write predictions to a file or accumulate a summary. Without a sink, the result blocks are collected into a single R object, whose memory requirement grows with the number of observations.
# S3 method for fastglm_stream
predict(
object,
newdata = NULL,
type = c("link", "response"),
se.fit = FALSE,
dispersion = NULL,
sink = NULL,
...
)Predictions (a `fastglm_prediction` list when `se.fit=TRUE`), or invisibly the number of chunks delivered to a sink. Each prediction block supplied to a sink uses the same structure. See fastglm-prediction-methods.
a streaming GLM fit.
optional prediction data; otherwise rereads the fitted source.
prediction arguments as in [predict.fastglm()].
optional function of `(value, chunk_index)` that processes or writes each result block. Its return value is ignored.
additional prediction arguments.