RWeka (version 0.1-0)

cppredict: Posterior Class Probabilities

Description

Compute posterior class distributions for fitted Weka classifier models (if possible) by applying the Weka method distributionForInstance to each test instance.

Usage

cppredict(object, newdata, ...)

Arguments

object
an object of class inheriting from Weka_classifier.
newdata
an optional data frame in which to look for variables with which to predict. If omitted or NULL, the training instances are used.
...
further arguments passed to or from other methods.

Value

  • A matrix with the posterior class probabilities, with rows corresponding to instances and columns to classes.

Examples

Run this code
m <- J48(Species ~ ., data = iris)
cppredict(m)[1:10, ]

Run the code above in your browser using DataCamp Workspace