plusminusFit: Plus-Minus (Mas-o-Menos) Classifier

View source: R/plusminusFit.R

plusminusFitR Documentation

Plus-Minus (Mas-o-Menos) Classifier

Description

Functions to perform plus-minus classifier with a formula interface. Leave one out crossvalidation also implemented. Model extraction, plot, print and summary methods are also implemented.

Usage

plusminusFit(formula, data, subset, na.action, method = "plusminus", n_cores = 2,
                         validation = c("loo", "none"), model = TRUE,
                         x = FALSE, y = FALSE, ...)

## S3 method for class 'plusminus'
summary(object,...)

Arguments

formula

a model formula (see below).

data

an optional data frame containing the variables in the model.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

na.action

a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. The default is na.omit. Another possible value is NULL, no action. Value na.exclude can be useful.

method

the classification algorithm to be used.

n_cores

Number of cores to run for parallel processing. Currently set to 2 with the max being 4.

validation

character. What kind of (internal) validation to use. See below.

model

an optional data frame containing the variables in the model.

x

a logical. If TRUE, the model matrix is returned.

y

a logical. If TRUE, the response is returned.

object

an object of class "plusminus", i.e., a fitted model.

...

additional arguments, passed to the underlying fit functions, and plusminus. Currently not in use.

Details

The function fits a Plus-Minus classifier.

The formula argument should be a symbolic formula of the form response ~ terms, where response is the name of the response vector and terms is the name of one or more predictor matrices, usually separated by +, e.g., y ~ X + Z. See lm for a detailed description. The named variables should exist in the supplied data data frame or in the global environment. The chapter Statistical models in R of the manual An Introduction to R distributed with R is a good reference on formulas in R.

If validation = "loo", leave-one-out cross-validation is performed. If validation = "none", no cross-validation is performed.

Value

An object of class plusminus is returned. The object contains all components returned by the underlying fit function. In addition, it contains the following:

coefficients

Plus-Minus regression coefficients

X

X matrix

Y

actual response values (class labels)

val.method

validation method

call

model call

terms

model terms

mm

model matrix

model

fitted model

Author(s)

Richard Baumgartner (richard_baumgartner@merck.com), Nelson Lee Afanador (nelson.afanador@mvdalab.com)

References

Zhao et al.: Mas-o-menos: a simple sign averaging method for discriminationin genomic data analysis. Bioinformatics, 30(21):3062-3069,2014.

See Also

plusminus.fit, plusminus.loo

Examples

###  PLUS-Minus CLASSIFIER WITH validation = 'none', i.e. no CV ###
data(plusMinusDat)
mod1 <- plusminusFit(Y ~., data = plusMinusDat, validation = "none", n_cores = 2)
summary(mod1)

###  Plus-Minus CLASSIFIER WITH validation = 'loo', i.e. leave-one-out CV ###
## Not run: 
data(plusMinusDat)
mod2 <- plusminusFit(Y ~., data = plusMinusDat, validation = "loo", n_cores = 2)
summary(mod2)

## End(Not run)

mvdalab documentation built on Oct. 6, 2022, 1:05 a.m.