predict.linearr: Predict Linear Regression

Description Usage Arguments Value Examples

View source: R/predict.R

Description

Generates prediction for linear regression. Note that one can either input a 'linearr' object or a matrix of beta coefficients.

Usage

1
2
## S3 method for class 'linearr'
predict(object, X, y = NULL, ...)

Arguments

object

'linearr' object or matrix of betas

X

matrix or data frame of (new) observations

y

optional, matrix or vector of response values

...

additional arguments

Value

predictions and loss metrics

Examples

1
2
3
4
5
library(dplyr)
X = dplyr::select(iris, -c(Species, Sepal.Length))
y = dplyr::select(iris, Sepal.Length)
fitted = linearr(X, y, lam = 0.1)
predict(fitted, X)

MGallow/logitr documentation built on June 26, 2018, 5:10 a.m.