| ndlCrossvalidate {ndl} | R Documentation |
Crossvalidation of a Naive Discriminative Learning model.
Description
ndlCrossvalidate undertakes a crossvalidation of a Naive
Discriminative Learning model fitted using ndlClassify.
Usage
ndlCrossvalidate(formula, data, frequency=NA, k=10, folds=NULL, ...)
Arguments
formula |
An object of class |
data |
A data frame (as in |
frequency |
A numeric vector (or the name of a column in the input data frame) with the frequencies of the exemplars. If absent, each exemplar is assigned a frequency equal to 1. |
k |
The number of folds, by default equal to 10. |
folds |
A list of user-defined folds, each item on the list representing a
vector of indices indicating lines in the data frame to be used
for testing a model fitted with the rest of the data. By default
|
... |
Control arguments to be passed along to auxiliary functions, in specific
|
Details
Crossvalidation of a Naive Discriminative Learning model.
Value
A list of the class "ndlCrossvalidate" with the following components:
callThe call matched by
ndlCrossvalidateformulaThe formula specified for
ndlCrossvalidatefitsA list of individual fits resulting from
ndlCrossvalidatekThe number of folds, by default equal to 10
n.totalThe sum frequency of data points
n.trainThe size of the training set
n.testThe size of of the testing set
foldsA list with the folds used in the crossvalidation; either selected at random by
ndlCrossvalidateor provided by the user.
Author(s)
Antti Arppe
References
Baayen, R. H. and Milin, P. and Filipovic Durdevic, D. and Hendrix, P. and Marelli, M., An amorphous model for morphological processing in visual comprehension based on naive discriminative learning. Psychological Review, 118, 438-482.
Arppe, A. and Baayen, R. H. (in prep.). Statistical modeling and the principles of human learning.
See Also
summary.ndlCrossvalidate, ndlStatistics, ndlCuesOutcomes,
cueCoding, estimateWeights, estimateActivations
Examples
data(think)
set.seed(314)
think <- think[sample(1:nrow(think),500),]
think.cv5 <- ndlCrossvalidate(Lexeme ~ Agent + Patient, data=think, k=5)
summary(think.cv5)
rm(think)
## Not run:
data(think)
think.cv10 <- ndlCrossvalidate(Lexeme ~ Person + Number + Agent + Patient + Register,
data=think, k=10)
summary(think.cv10)
## End(Not run)
## Not run:
library(languageR)
data(finalDevoicing)
finDev.cv10 <- ndlCrossvalidate(Voice ~ Onset1Type + Onset2Type + VowelType *
ConsonantType * Obstruent + Nsyll + Stress, data=finalDevoicing, k=10)
summary(finDev.cv10)
## End(Not run)