logisticRegression: Run a Logistic Regression

Description Usage Arguments Details Value Examples

Description

Run a Logistic Regression given training data (and optional test data).

Usage

1
logisticRegression(train, labels, test = NULL)

Arguments

train

A matrix of training data values

labels

An integer vector of target (class) labels, with the same length as the training data set

test

An optional test set, with the same number of columns as the test set.

Details

This function uses a train set matrix and vector of target labels to run a logistic regression. If an optional test data set is supplied, it will be evaluated given the estimates from the initial test set.

Value

A list with several components: means of training data means, variance of training data variances, probanbilities of training data class probabilities. If a test data set was supplied an estimated classification vector is also returned.

Examples

1
2
3
4
5
6
data(trainSet)
mat <- t(trainSet[, -5])     ## train data, transpose and removing class labels
lab <- trainSet[, 5]         ## class labels for train set
logisticRegression(mat, lab)
testMat <- t(testSet[, -5])  ## test data
logisticRegression(mat, lab, testMat)

eddelbuettel/rcppmlpack2 documentation built on May 15, 2019, 10:33 p.m.