Description Usage Arguments Value Examples
View source: R/treeda-functions.R
Given a fitted treeda
model, get the predicted
classes and projections onto the discriminating axes for new data.
1 2 |
object |
Output from |
newdata |
New predictor matrix in the same format as the
|
newresponse |
New response vector, not required. |
check.consist |
Check the consistency between the tree and predictor matrix? |
... |
Not used. |
A list containing the projections of the new data onto the
discriminating axes (projections
), the predicted classes
(classes
), and the rss (rss
, only included if the
ground truth for the responses is available).
1 2 3 4 5 6 7 8 9 10 11 | data(treeda_example)
out.treeda = treeda(response = treeda_example$response,
predictors = treeda_example$predictors,
tree = treeda_example$tree,
p = 1)
## Here we are predicting on the training data, in general this
## would be done on a held out test set
preds = predict(out.treeda, newdata = treeda_example$predictors,
newresponse = treeda_example$response)
## make a confusion matrix
table(preds$classes, treeda_example$response)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.