externalValidation.probMatrix: Probability matrix.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/functions.public.R

Description

Generates the probability matrix.

Usage

1
externalValidation.probMatrix(queryResult, realLabels, numDecimals=2)

Arguments

queryResult

Object returned by queryGeNetClassifier

realLabels

Factor. Actual/real class of the samples.

numDecimals

Integer. Number of decimals to return.

Details

A probability matrix contains the probabilities of assigning each assigned sample to each class. They help identifying where errors are likelly to occur even though there were not actual errors in the external/cross validation.

Value

The probability matrix.

Author(s)

Bioinformatics and Functional Genomics Group. Centro de Investigacion del Cancer (CIC-IBMCC, USAL-CSIC). Salamanca. Spain

See Also

Main package function and classifier training: geNetClassifier
Query the classifier: queryGeNetClassifier
Query summary: querySummary
External validation stats: externalValidation.stats

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
##########################
## Classifier training
##########################

# Load an expressionSet:
library(leukemiasEset)
data(leukemiasEset)

# Select the train samples: 
trainSamples<- c(1:10, 13:22, 25:34, 37:46, 49:58) 
# summary(leukemiasEset$LeukemiaType[trainSamples])

# Train a classifier or load a trained one:
# leukemiasClassifier <- geNetClassifier(leukemiasEset[,trainSamples], 
#    sampleLabels="LeukemiaType", plotsName="leukemiasClassifier") 
data(leukemiasClassifier) # Sample trained classifier

##########################
## External Validation
##########################
# Select the samples to query the classifier 
#   - External validation: samples not used for training
testSamples <- c(1:60)[-trainSamples]         

# Make a query to the classifier:
queryResult <- queryGeNetClassifier(leukemiasClassifier, leukemiasEset[,testSamples])

# Obtain the probability matrix for the assigned samples:
externalValidation.probMatrix(queryResult, leukemiasEset[,testSamples]$LeukemiaType)

geNetClassifier documentation built on Nov. 8, 2020, 4:53 p.m.