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:
call
The call matched by
ndlCrossvalidate
formula
The formula specified for
ndlCrossvalidate
fits
A list of individual fits resulting from
ndlCrossvalidate
k
The number of folds, by default equal to 10
n.total
The sum frequency of data points
n.train
The size of the training set
n.test
The size of of the testing set
folds
A list with the folds used in the crossvalidation; either selected at random by
ndlCrossvalidate
or 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)