"pcaNNet"(x, y, thresh = 0.99, ...)
"pcaNNet"(formula, data, weights, ..., thresh = .99, subset, na.action, contrasts = NULL)
"predict"(object, newdata, type = c("raw", "class", "prob"), ...)
class ~ x1 + x2 + ...
x
values for examples.
thresh = .95
formula
are
preferentially to be taken.
NA
s are found.
The default action is for the procedure to fail. An alternative is
na.omit, which leads to rejection of cases with missing values on
any required variable. (NOTE: If given, this argument must be named.)
pcaNNet
as returned by pcaNNet
.
nnet
, such as size
, decay
, etc.
pcaNNet
, an object of "pcaNNet"
or "pcaNNet.formula"
. Items of interest in the output are:thresh
argument to determine how many components must be retained to capture this amount of variance in the predictors.The principal components are then used in a neural network model.
When predicting samples, the new data are similarly transformed using the information from the PCA analysis on the training data and then predicted. Because the variance of each predictor is used in the PCA analysis, the code does a quick check to make sure that each predictor has at least two distinct values. If a predictor has one unique value, it is removed prior to the analysis.
nnet
, preProcess
data(BloodBrain)
modelFit <- pcaNNet(bbbDescr[, 1:10], logBBB, size = 5, linout = TRUE, trace = FALSE)
modelFit
predict(modelFit, bbbDescr[, 1:10])
Run the code above in your browser using DataLab