predict.logisticr: Predict Logistic Regression

Description Usage Arguments Value Examples

View source: R/predict.R

Description

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

Usage

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

Arguments

object

'logisticr' object or matrix of betas

X

matrix or data frame of (new) observations

y

optional, matrix or vector of response values 0,1

...

additional arguments

Value

predictions and loss metrics

Examples

1
2
3
4
5
6
7
8
library(dplyr)
X = dplyr::select(iris, -Species)
y = dplyr::select(iris, Species)
y$Species = ifelse(y$Species == 'setosa', 1, 0)
logisticr(X, y)

fitted = logisticr(X, y, lam = 0.1, penalty = 'ridge', method = 'MM')
predict(fitted, X)

MGallow/logitr documentation built on May 6, 2019, 12:06 a.m.