vcr.neural.train {classmap} | R Documentation |
Prepare for visualization of a neural network classification on training data.
Description
Produces output for the purpose of constructing graphical displays such as the classmap
. The user first needs train a neural network. The representation of the data in a given layer (e.g. the final layer before applying the softmax function) then serves as the argument X
to vcr.neural.train
.
Usage
vcr.neural.train(X, y, probs, estmethod = meancov)
Arguments
X |
the coordinates of the |
y |
factor with the given class labels of the objects. Make sure that the levels are in the same order as used in the neural net, i.e. the columns of its binary "once-hot-encoded" response vectors. |
probs |
posterior probabilities obtained by the neural
net, e.g. in keras. For each case (row of |
estmethod |
function for location and covariance estimation.
Should return a list with |
Value
A list with components:
X |
the coordinates of the |
yint |
number of the given class of each case. Can contain |
y |
given class label of each case. Can contain |
levels |
levels of |
predint |
predicted class number of each case. For each case this is the class with the highest posterior probability. Always exists. |
pred |
predicted label of each case. |
altint |
number of the alternative class. Among the classes different from the given class, it is the one with the highest posterior probability. Is |
altlab |
label of the alternative class. Is |
ncolX |
number of columns in |
PAC |
probability of the alternative class. Is |
computeMD |
Whether or not the farness is computed using the Mahalanobis distance. |
classMS |
list with center and covariance matrix of each class |
PCAfits |
if not |
figparams |
parameters for computing |
fig |
distance of each case |
farness |
farness of each case from its given class. Is |
ofarness |
for each case |
Author(s)
Raymaekers J., Rousseeuw P.J.
References
Raymaekers J., Rousseeuw P.J.(2021). Silhouettes and quasi residual plots for neural nets and tree-based classifiers. (link to open access pdf)
See Also
vcr.neural.newdata
, classmap
, silplot
, stackedplot
Examples
# For examples, we refer to the vignette:
## Not run:
vignette("Neural_net_examples")
## End(Not run)