Learn R Programming

mdatools (version 0.7.0)

simcares: Results of SIMCA one-class classification

Description

simcares is used to store results for SIMCA one-class classification.

Usage

simcares(pres, cres)

Arguments

pres
results of PCA decomposition of data (class pcares).
cres
results of classification (class classres).

Value

Returns an object (list) of class simcares with the same fields as pcares plus extra fields, inherited from classres:
c.pred
predicted class values (+1 or -1).
c.ref
reference (true) class values if provided.
The following fields are available only if reference values were provided.
tp
number of true positives.
fp
nmber of false positives.
fn
number of false negatives.
specificity
specificity of predictions.
sensitivity
sensitivity of predictions.

Details

Class simcares inherits all properties and methods of class pcares, and has additional properties and functions for representing of classification results, inherited from class classres.

There is no need to create a simcares object manually, it is created automatically when build a SIMCA model (see simca) or apply the model to a new data (see predict.simca). The object can be used to show summary and plots for the results.

See Also

Methods for simcares objects:
print.simcares
shows information about the object.
summary.simcares
shows statistics for results of classification.

Methods, inherited from classres class:

showPredictions.classres
show table with predicted values.
plotPredictions.classres
makes plot with predicted values.
plotSensitivity.classres
makes plot with sensitivity vs. components values.
plotSpecificity.classres
makes plot with specificity vs. components values.
plotPerformance.classres
makes plot with both specificity and sensitivity values.

Methods, inherited from ldecomp class:

plotResiduals.ldecomp
makes Q2 vs. T2 residuals plot.
plotScores.ldecomp
makes scores plot.
plotVariance.ldecomp
makes explained variance plot.
plotCumVariance.ldecomp
makes cumulative explained variance plot.
Check also simca and pcares.

Examples

Run this code
## make a SIMCA model for Iris setosa class and show results for calibration set
library(mdatools)

data = iris[, 1:4]
class = iris[, 5]

# take first 30 objects of setosa as calibration set
se = data[1:30, ]

# make SIMCA model and apply to test set
model = simca(se, 'Se')
model = selectCompNum(model, 1)

# show infromation and summary
print(model$calres)
summary(model$calres)

# show plots
layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE))
plotPredictions(model$calres, show.labels = TRUE)
plotResiduals(model$calres, show.labels = TRUE)
plotPerformance(model$calres, show.labels = TRUE, legend.position = 'bottomright')
layout(1, 1, 1)

# show predictions table
showPredictions(model$calres)

Run the code above in your browser using DataLab