predict.damultinom: Predict New Examples by a Trained Discriminant Adaptive...

Description Usage Arguments Details Value References See Also Examples

View source: R/damultinom.R

Description

Predict new examples by a trained discriminant adaptive multinomial model.

Usage

1
predict.damultinom(object, newdata, ...)

Arguments

object

Object of class "damultinom".

newdata

A matrix or data.frame of test examples. A vector is considered to be a row vector comprising a single case.

...

Arguments passed to or from other methods.

Details

This function is a method for the generic function predict() for class "damultinom". It can be invoked by calling predict(x) for an object x of the appropriate class, or directly by calling predict.damultinom(x) regardless of the class of the object.

In contrast to predict.multinom predict.damultinom does not have a type argument. Both, the predicted posterior probabilities and the class labels, are returned.

Value

A list with components:

class

The predicted class labels (a factor).

posterior

Matrix of class posterior probabilities.

References

Hand, D. J., Vinciotti, V. (2003), Local versus global models for classification problems: Fitting models where it matters, The American Statistician, 57(2) 124–130.

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

See Also

damultinom, dannet, multinom, nnet.

Examples

1
2
3
4
5
6
7
fit <- damultinom(Species ~ Sepal.Length + Sepal.Width, data = iris, wf = "gaussian", bw = 0.5, Hess=TRUE)
pred <- predict(fit)
mean(pred$class != iris$Species)

fit <- damultinom(Species ~ Sepal.Length + Sepal.Width, data = iris, wf = "gaussian", bw = 0.5, weights=1:nrow(iris), trace=FALSE)
pred <- predict(fit)
mean(pred$class != iris$Species)

schiffner/locClass documentation built on May 29, 2019, 3:39 p.m.