simcares | R Documentation |
@description
simcares
is used to store results for SIMCA one-class classification.
simcares(class.res, pca.res = NULL)
class.res |
results of classification (class |
pca.res |
results of PCA decomposition of data (class |
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.
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. |
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 | predicted classes plot. |
plotSensitivity.classres | sensitivity plot. |
plotSpecificity.classres | specificity plot. |
plotPerformance.classres | performance plot. |
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
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.