predict.twinspan: Predict Class Membership of Quadrats

predict.twinspanR Documentation

Predict Class Membership of Quadrats

Description

Function predicts the class membership for each quadrat using the reported indicator pseudospecies and limit for the indicator score for the “positive” (right) group.

Usage

## S3 method for class 'twinspan'
predict(object, newdata, level, binname = FALSE, ...)

Arguments

object

twinspan result object.

newdata

Data used in prediction. The species will be matched by their names, and the pseudospecies are based on the cutlevels used in the original twinspan model.

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).

Details

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.

See Also

cut.twinspan gives the original classification, and misclassified analyses the differences of this and predict.

Examples


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,])


jarioksa/twinspan documentation built on Nov. 23, 2024, 2:49 p.m.