predict.ndlClassify: Predict method for ndlClassify objects

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Obtains predictions on the basis of a fitted "ndlClassify" object on data already incorporated in the object or on new data with the same predictors as the originally fitted model object.

Usage

1
2
3
## S3 method for class 'ndlClassify'
predict(object, newdata=NULL, frequency=NA,
   type="choice", ...)

Arguments

object

objects of class "ndlClassify", typically the result of a call to ndlClassify.

newdata

optionally, a data frame in which to look for variables with which to predict. If omitted (i.e. set to NULL), the original data used to fit the object are used.

frequency

A numeric vector (or the name of a column in the (new) data frame newdata) with the frequencies of the exemplars. If absent, each exemplar is assigned a frequency equal to 1.

type

the type of prediction requested. The default option type="choice" produces the predicted individual discrete choices (i.e. Outcomes), given the predictor Cues selected for fitting the original object. The option type="acts" provides the sum activations for each Outcome given the Cue combinations in newdata (or in the original data in object, while the alternative type="probs" yields the distributions of predicted probabilities (based on the activations) over the Outcome responses.

...

further arguments passed to and from other functions.

Details

If newdata is omitted the predictions are based on the data used for the fit.

Value

a vector predicted, or matrix of activations activations, or a matrix of predictions probabilities.

Author(s)

Antti Arppe

References

Arppe, A. and Baayen, R. H. (in prep.) Statistical classification and principles of human learning.

See Also

ndlClassify, estimateActivations, acts2probs

Examples

1
2
3
4
5
data(think)
think.ndl <- ndlClassify(Lexeme ~ Agent + Patient, data=think[1:300,])
head(predict(think.ndl, type="choice"))
predict(think.ndl, newdata=think[301:320,], type="probs")
predict(think.ndl, newdata=think[301:320,], type="acts")

ndl documentation built on May 2, 2019, 10:28 a.m.