citrus.getCVMinima: Get regularization thresholds of pre-selected...

View source: R/citrus.model.R

citrus.getCVMinimaR Documentation

Get regularization thresholds of pre-selected cross-validation points

Description

#' Get regularization thresholds of pre-selected cross-validation points and their indicies.

Usage

citrus.getCVMinima(modelType, thresholdCVRates, fdrRate = 0.01)

Arguments

modelType

Method to be used for model-fitting. Valid options are: glmnet,pamr, and sam.

thresholdCVRates

Matrix of error rates at regularizationThresholds returned by citrus.thresholdCVs.* function.

fdrRate

FDR Maximum used to determine FDR-constrained model regularization threshold.

Details

For predictive models (i.e. pamr or glmnet), returns indicies of regularization thresholds producing the minimum cross validation error rate (cv.min), the simplest model having error within 1 standard error of the minimum (cv.1se), and the model with the minimum error having an FDR rate < fdrRate (cv.fdr.constrained) when possible.

Value

List of regularization thresholds and indicies based on pre-selected cross-validation error rates points.

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))

# Calculate regularization thresholds
regularizationThresholds = citrus.generateRegularizationThresholds(abundanceFeatures,labels,modelType="pamr",family="classification")

# Calculate CV Error rates
thresholdCVRates = citrus.thresholdCVs.quick("pamr",abundanceFeatures,labels,regularizationThresholds,family="classification")

# Get pre-selected CV Minima
cvMinima = citrus.getCVMinima("pamr",thresholdCVRates)

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