Learn R Programming

bigFastlm (version 0.0.1)

predict.bigLm: Prediction method for bigLm fitted objects

Description

Prediction method for bigLm fitted objects

Usage

"predict"(object, newdata = NULL, ...)

Arguments

object
fitted "bigLm" model object
newdata
big.matrix object. If NULL, then fitted values are returned
...
not used

Value

An object depending on the type argument

Examples

Run this code

library(bigmemory)

nrows <- 50000
ncols <- 50
bkFile <- "bigmat3.bk"
descFile <- "bigmatk3.desc"
bigmat <- filebacked.big.matrix(nrow=nrows, ncol=ncols, type="double",
                                backingfile=bkFile, backingpath=".",
                                descriptorfile=descFile,
                                dimnames=c(NULL,NULL))

# Each column value with be the column number multiplied by
# samples from a standard normal distribution.
set.seed(123)
for (i in 1:ncols) bigmat[,i] = rnorm(nrows)*i

y <- rnorm(nrows) + bigmat[,1]

system.time(lmr1 <- bigLm(bigmat, y))


preds <- predict(lmr1, newdata = bigmat)

Run the code above in your browser using DataLab