getClassification(SlimPLS)
getClassification()所属R语言包:SlimPLS
Predicts classes of a samples in a given expression matrix
预测类的样品在给定的表达矩阵
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Predicts classes of a samples in a given expression matrix, using a given classification model. The function runs a classification prediction algorithm on the given expression matrix using a model learned earlier by trainClassifier. The model holds both a set of features and a specific model suited for a specific algorithm.
预测在给定的表达矩阵类的一个样本,使用给定的分类模型。函数运行一个使用模型前面学到的trainClassifier在给定的表达矩阵的分类预测算法。该模型拥有一套功能和一个特定的算法适用于一个特定的模式。
用法----------Usage----------
getClassification(exp_mat, model)
参数----------Arguments----------
参数:exp_mat
exp_mat is an expression matrix of type expMat, usually created by reading an expression matrix from a file using readExpMat. The matrix is supposed to have samples in its columns, and features in its rows.
exp_mat是一个表达式,矩阵型expMat,通常创建从文件读取表达矩阵readExpMat。在其列的矩阵应该有样品,并在其行的功能。
参数:model
model is a classificationModel object, output by trainClassifier. It holds both the features selected earlier for dimension reduction of the expression matrix, and a specific algorithm classification model learned earlier using the exact set of features
model是classificationModel对象,输出trainClassifier。它拥有选择的功能的表达矩阵降维,分类模型和一个特定的算法使用的是完全相同的功能集,前面学到的
Details
详细信息----------Details----------
The function first takes the set of features and reduces the matrix dimension according to the given set of features that reside in the classification model supplied. It then runs the specific prediction algorithm of the given model. The function is indifferent to the model and feature set supplied.
该函数首先需要的功能和降低了矩阵维数,根据给定的功能,在提供的分类模型。然后,它运行的具体预测算法,给定的模型。是冷漠的模型和功能集提供的功能。
值----------Value----------
Returns a named vector, with samples as names and value 1 or 2 as class prediction for each sample.
返回一个已命名的向量,名称和样品,每个样品的类预测值1或2。
参见----------See Also----------
selectFeatures, selectFeaturesSlimPLS, trainClassifier, readExpMat
selectFeatures,selectFeaturesSlimPLS,trainClassifier,readExpMat
实例----------Examples----------
# reads an expression matrix with class labels into exp_mat_train[读取表达矩阵类标签exp_mat_train]
## Not run: [#不运行:]
exp_mat_train <- readExpMat("golub_leukemia_data_with_classes_training.csv", TRUE)
## End(Not run)[#(不执行)]
# selects a set of features into the features2 variable. The matrix we read has a class[选择一套功能到features2变量。的矩阵,我们有一个类]
# label for each sample in its second row. Labels are either "AML" or "ALL".[每个样品在其第二行中的标签。标签是“反垄断法”或“ALL”。]
# Selection is done using the SlimPLS method. Up to two components with 25 features in[选择做使用SlimPLS方法。两部件25功能]
# each component will be selected.[每个组件将被选中。]
## Not run: [#不运行:]
features2 <- selectFeaturesSlimPLS(exp_mat_train, class_a="AML", class_b="ALL",
num_features=50, component_size=25,
p_value_threshold=0)
## End(Not run)[#(不执行)]
# train a SVM classifier with linear kernel on the expression matrix using the[训练SVM分类与表达矩阵的线性核]
# individual feature that are part of the components selected earlier, and are now in[单独的功能,是先前选定的组件的一部分,现在在]
# features2.[features2。]
## Not run: [#不运行:]
model_t <- trainClassifier("SVM_LINEAR", exp_mat_train, 0,0, "AML", "ALL",
features2, FALSE )
## End(Not run)[#(不执行)]
# reads an unlabeled expression matrix exp_mat_test[读取未标记的表达矩阵exp_mat_test]
## Not run: [#不运行:]
exp_mat_test <- readExpMat("golub_leukemia_data_test.csv", FALSE)
## End(Not run)[#(不执行)]
# classify the samples in the test matrix using the model we build:[在使用我们所建立的模型的测试矩阵分类的样本:]
## Not run: [#不运行:]
getClassification(exp_mat_test, model_t)
## End(Not run)[#(不执行)]
# the results should be:[结果应该是:]
#[]
# ALL-T-cell-10 ALL-T-cell-11 ALL-T-cell-14 ALLB-cell71 ALLB-cell72 ALL-B-cell-8[ALL-T-单元10 ALL-T-单元11 ALL-T-单元14 ALLB cell71 ALLB cell72 ALL-B单元-8]
# 2 2 2 2 2 2 [2 2 2 2 2 2]
# AML60 AML61 AML62 AML63 AML64 [AML60 AML61 AML62 AML63 AML64]
# 1 1 1 1 1[1 1 1 1 1]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|