Learn R Programming

mdatools (version 0.14.1)

simcares: Results of SIMCA one-class classification

Description

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

Usage

simcares(class.res, pca.res = NULL)

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.

Arguments

class.res

results of classification (class classres).

pca.res

results of PCA decomposition of data (class pcares).

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.simcaresshows information about the object.
summary.simcaresshows statistics for results of classification.

Methods, inherited from classres class:

showPredictions.classresshow table with predicted values.
plotPredictions.classrespredicted classes plot.
plotSensitivity.classressensitivity plot.
plotSpecificity.classresspecificity plot.
plotPerformance.classresperformance plot.

Methods, inherited from ldecomp class:

plotResiduals.ldecompmakes Q2 vs. T2 residuals plot.
plotScores.ldecompmakes scores plot.
plotVariance.ldecompmakes explained variance plot.
plotCumVariance.ldecompmakes 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