predict.logistic_regression: Predicts labels of a test set using a 0.5 cutoff

Description Usage Arguments Value

View source: R/logistic_regression.R

Description

If σ(x_i^\top β) > 0.5 then observation i is assigned class 1. Otherwise it is assigned class 0.

Usage

1
2
## S3 method for class 'logistic_regression'
predict(lr, xtest)

Arguments

lr

Instance of class logistic_regression.

xtest

Matrix of dimension (number of test observations, number of features + 1) containing a testing observation in every row and a feature in every column. Notice that the first column must contain only 1s to fit the intercept.

Value

Column vector of dimension (number of test observations, 1) with a label of '0' or '1' for every test observation.


MauroCE/LogisticRegression documentation built on Jan. 18, 2020, 10:04 a.m.