modelData: Returns indices for data to be used to create the final...

View source: R/modelData.R

modelDataR Documentation

Returns indices for data to be used to create the final classification model

Description

Returns indices for data to be used to create the final classification model

Usage

modelData(x, type = c("bead", "doublet", "debris", "dead"), n = 4000)

Arguments

x

A SingleCellExperiment created with readCytof with the scores and initial columns filled out for the event type of interest.

type

Identifies the type of label that is being modeled. Must be 'bead', 'doublet', 'debris', or 'dead'. Note that if no type of label is specified 'bead' will be used.

n

number of indices to return.

Details

The indices that are returned by modelData are be used to create a model that can be used to classify the observations with regard to the parameter of interest (bead, doublet, debris, dead). It is used as part of gbmLabel, rfLabel, svmLable, and labelQC. The function modelData uses the score and the function initialGuess to randomly select a set of data points that we are confident are of the event type and not of the selected event type that can be used to train the data. Only points that are labeled as -1 and 1 are considered for the training dataset. The selected dataset is balance with a fairly equal number of points from each group.

Value

An integer vector that contains the indices of the events that should be included in the creation of the final classification model for the event type of interest (bead, debris, doublet, dead).

Examples

data("raw_data", package = "CATALYST")
sce <- readCytof(raw_data, beads = "Beads", viability = c("cisPt1", "cisPt2"))
sce <- initialBead(sce)
train <- modelData(sce, type = "bead", n = 4000)


jillbo1000/cytofQC documentation built on Aug. 23, 2023, 9:47 p.m.