predict.twinspan | R Documentation |
Function predicts the class membership for each quadrat using the reported indicator pseudospecies and limit for the indicator score for the “positive” (right) group.
## S3 method for class 'twinspan'
predict(object, newdata, level, binname = FALSE, ...)
object |
|
newdata |
Data used in prediction. The species will be matched
by their names, and the pseudospecies are based on the
|
level |
Level of hierarchy of classification. If missing, the prediction is made to the highest level of classification. |
binname |
Use binary labels instead of decimal class numbers. |
... |
Other parameters passed to the function (ignored). |
The twinspan
classification is based on splicing polarized
ordination axis, and the reported indicator pseudospecies only
indicate the decisions in each division, and do not necessarily
give the same classification: The original classification cannot be
necessarily found when giving the original data as
newdata
. In the original TWINSPAN this is called
misclassification.
cut.twinspan
gives the original
classification, and misclassified
analyses the
differences of this and predict
.
data(ahti)
tw <- twinspan(ahti)
predict(tw)
predict(tw, level=3)
## misclassifications: predict and twinspan differ
sum(predict(tw) != cut(tw))
## build model for 4/5 of data and predict for the removed 1/5
i <- rep(1:5, length = nrow(ahti))
i <- sample(i) # shuffle in random order
tw <- twinspan(ahti[i != 1,]) # remove i==1
predict(tw, newdata = ahti[i==1,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.