citrus.buildEndpointModel: Build an endpoint model

View source: R/citrus.model.R

citrus.buildEndpointModelR Documentation

Build an endpoint model

Description

This function constructs an endpoint model using features calculated by citrus.

Usage

citrus.buildModel.classification(features, labels, type,
  regularizationThresholds, ...)

citrus.buildModel.continuous(features, labels, type, regularizationThresholds,
  ...)

citrus.buildEndpointModel(features, labels, family = "classification",
  type = "pamr", regularizationThresholds = NULL, ...)

print.citrus.endpointModel(citrus.endpointModel, ...)

Arguments

features

A numeric matrix of predictive features. Rows are observations and column entries are features.

labels

A vector of endpoint values (i.e. class labels) for each row of the feature matrix.

type

Statistical model to be used. For family="classification", options are pamr (Nearest Shrunken Centroid), glmnet (Lasso-regularized logistic regression), and sam (Non-parametric test in differences of means). For family="continuous", options are glmnet (L1-regularized linear regression), and sam.

regularizationThresholds

Vector of regularization values for penalized model construction. If NULL, values are automatically generated. Not valid for sam models.

...

Other parameters passed to model-fitting procedures.

family

Family of endpoint model to be constructed. Valid values are classification and continuous.

Value

An object of class citrus.endpointModel with properties:

model

The statistical model fit on supplied data.

regularizationThresholds

Regularization Thresholds used to constrain penalized models.

family

Family of model.

type

Model type.

Author(s)

Robert Bruggner

Examples

# Where the data lives
dataDirectory = file.path(system.file(package = "citrus"),"extdata","example1")

# Create list of files to be analyzed
fileList = data.frame("unstim"=list.files(dataDirectory,pattern=".fcs"))

# Read the data
citrus.combinedFCSSet = citrus.readFCSSet(dataDirectory,fileList)

# List of columns to be used for clustering
clusteringColumns = c("Red","Blue")

# Cluster data
citrus.clustering = citrus.cluster(citrus.combinedFCSSet,clusteringColumns)

# Large enough clusters
largeEnoughClusters = citrus.selectClusters(citrus.clustering)

# Build features
abundanceFeatures = citrus.calculateFeatures(citrus.combinedFCSSet,clusterAssignments=citrus.clustering$clusterMembership,clusterIds=largeEnoughClusters)

# List disease group of each sample
labels = factor(rep(c("Healthy","Diseased"),each=10))

# Build model
endpointModel = citrus.buildEndpointModel(abundanceFeatures,labels)

nolanlab/citrus documentation built on April 19, 2024, 6:49 p.m.