logistic_model: Logistic model object class

Description Fields Methods

Description

This reference class object fits a binary classification model, using the logistic_reg function. The model can be used to predict the classes of new samples. The sample classes must be 0 or 1, and the prediction returns the estimated probabilities that each sample is class 1. A decision threshold should be subsequently.

Fields

X

An nxd matrix with samples as rows and features as columns.

y

A length-n vector of 0s and 1s indicating true sample classes.

coeffs

A length-d vector of model coefficients.

lambda

regularization parameter

Methods

initialize(X, y, lambda = 1e-06)

Provide X and y and the coeffs field will be calculated using logistic_reg

predict(X_test)

Provide a matrix of new samples and a vector of P(y=1) is returned


ant-stephenson/lhc documentation built on Jan. 28, 2021, 3:47 p.m.