Description Usage Arguments Value References Examples
Predict from a least absolute shrinkage and selection operator fit.
1 | lasso.predict(lasso.intcv.model, pred.obj, pred.obj.group.id)
|
lasso.intcv.model |
a LASSO classifier built with |
pred.obj |
dataset to have its sample group predicted. The dataset must have rows as probes and columns as samples. It must have an equal number of probes as the dataset being trained. |
pred.obj.group.id |
a vector of sample-group labels for each sample of the dataset to be predicted.
It must have an equal length to the number of samples as |
a list of 3 elements:
pred |
predicted sample group for each sample |
mc |
a predicted misclassification error rate (external validation) |
prob |
predicted probability for each sample |
Friedman, J., Hastie, T. and Tibshirani, R. (2008) Regularization Paths for Generalized Linear Mod- els via Coordinate Descent, http://www.stanford.edu/~hastie/Papers/glmnet.pdf Journal of Statistical Software, Vol. 33(1), 1-22 Feb 2010
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | set.seed(101)
biological.effect <- estimate.biological.effect(uhdata = uhdata.pl)
ctrl.genes <- unique(rownames(uhdata.pl))[grep("NC", unique(rownames(uhdata.pl)))]
biological.effect.nc <- biological.effect[!rownames(biological.effect) %in% ctrl.genes, ]
group.id <- substr(colnames(biological.effect.nc), 7, 7)
biological.effect.train.ind <- colnames(biological.effect.nc)[c(sample(which(group.id == "E"), size = 64),
sample(which(group.id == "V"), size = 64))]
biological.effect.test.ind <- colnames(biological.effect.nc)[!colnames(biological.effect.nc) %in% biological.effect.train.ind]
biological.effect.nc.tr <- biological.effect.nc[, biological.effect.train.ind]
biological.effect.nc.te <- biological.effect.nc[, biological.effect.test.ind]
lasso.int <- lasso.intcv(X = biological.effect.nc.tr,
y = substr(colnames(biological.effect.nc.tr), 7, 7),
kfold = 5, seed = 1, alp = 1)
lasso.pred <- lasso.predict(lasso.intcv.model = lasso.int,
pred.obj = biological.effect.nc.te,
pred.obj.group.id = substr(colnames(biological.effect.nc.te), 7, 7))
lasso.int$mc
lasso.pred$mc
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.