Learn R Programming

RecordLinkage (version 0.2-0)

classifySupv: Supervised Classification

Description

Supervised classification of record pairs based on a trained model.

Usage

classifySupv(model, newdata, ...)

Arguments

model
Object of type RecLinkClassif. The trained model. See trainSupv.
newdata
Object of type RecLinkData. The data to classify.
...
Further arguments for the predict function.

Value

  • A RecLinkResult object which is a copy of newdata, except for element rpairs$prediction, which stores the classification result.

Details

The record pairs in newdata are classified by calling the appropriate predict function for model$model.

See Also

trainSupv for training of classifiers, classifyUnsup for unsupervised classification.

Examples

Run this code
# Split data into training and validation set, train and classify with rpart
data(RLdata500)
pairs=compare.dedup(RLdata500, identity=identity.RLdata500,
                    blockfld=list(1,3,5,6,7))
l=splitData(pairs, prop=0.5, keep.mprop=TRUE)                    
model=trainSupv(l$train, method="rpart", minsplit=5)
result=classifySupv(model=model, newdata=l$valid)
summary(result)

Run the code above in your browser using DataLab