cross.validate: K - cross validation

Description Usage Arguments Details Value Author(s) References Examples

View source: R/APFAfunctions.R

Description

The function measures the prediction efficiency of the model using K-fold cross-validation.

Usage

1
cross.validate(Data, K = 10, crit = NULL, beagle = TRUE, dir='')

Arguments

Data

A data frame

K

Number of cross validations

crit

The model selection criterion, either AIC or BIC, for penalised likelihood method.

beagle

If beagle=TRUE, the function performs model selection using BEAGLE.

dir

specifying the path for 'beagle.jar' directory.

Details

The cross validation for a given data frame is done as follows,\ 1. The data is divided in to K subsets of equal sizes.\ 2. At each cross validation step in k=1:K, $k^th$ subset is taken as the test data and the rest as training data.\ 3. APFA model is fitted to the training data using a model selection method (AIC, BIC or Beagle), then using the edge probabilities of the fitted model, the loglikelihood and the per-symbol loglikelihood are calculated for the test data set.\ 4. The function returns the mean of the log-likelihood from K-cross validation and pzero. \

Value

Returns per symbol loglikelihood of the K-cross validation.

Author(s)

Smitha Ankinakatte and David Edwards

References

Thollard, F.; Dupont, P. & de la Higuera, C. Probabilistic DFA Inference using Kullback-Leibler Divergence and Minimality 17th International Conference on Machine Learning., 2000, 975-982\

Examples

1
2

gRapfa documentation built on May 2, 2019, 6:54 a.m.