Description Usage Arguments Value Examples
View source: R/prepareDataforGlm.R
Given two vectors of factors (two identical levels) of equal length, calculate confusion matrix marginals
1 | compareModeltoTruth(estim, truth)
|
estim |
Vector holding a two level factor with the classification result. |
truth |
Vector holding a two level factor with the truth. |
A list with various key charactereistics of the resulting confusion matrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # get gene locations
mtor.loc <- findWells(experiments="brucella-du-k1", contents="MTOR")
scra.loc <- findWells(plates=sapply(mtor.loc, getBarcode),
contents="SCRAMBLED", well.names="G23")
# combine for faster fetching
data <- getSingleCellData(list(mtor.loc[[1]], scra.loc[[1]]))
mtor.dat <- meltData(cleanData(data[[1]]$H6))
scra.dat <- meltData(cleanData(data[[1]]$G23))
# prepare data for glm
data <- prepareDataforGlm(mtor.dat$mat$Cells, scra.dat$mat$Cells)
data <- makeRankFull(data)
# run glm
model <- glm("Response ~ .", binomial, data$train)
# compare to testing data
predi <- as.factor(round(predict(model, newdata=data$test,
type="response")))
levels(predi) <- c("active", "control")
comparison <- compareModeltoTruth(predi, data$test$Response)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.