Last data update: 2014.03.03

R: fits a maximum entropy model given a training matrix and a...
tune.maxentR Documentation

fits a maximum entropy model given a training matrix and a vector or factor of labels.

Description

Fits a multinomial logistic regression model of class maxent-class given a matrix or matrix.csr with training data, and a vector or factor with corresponding labels.

Usage

tune.maxent(feature_matrix, code_vector, nfold=3, showall=FALSE, verbose=FALSE)

Arguments

feature_matrix

A DocumentTermMatrix or TermDocumentMatrix (package tm), Matrix (package Matrix), matrix.csr (SparseM), data.frame, or matrix.

code_vector

A factor or vector of labels corresponding to each document in the feature_matrix.

nfold

An integer specifying the number of folds to perform for cross-validation. Defaults to 3.

showall

A logical specifying whether to show the accuracy results of all tested parameter configurations. Defaults to FALSE.

verbose

A logical specifying whether to provide descriptive output about the fitting process. Defaults to FALSE, or no output.

Value

Returns an object of class matrix with configurations along the y-axis and parameters along the x-axis.

Author(s)

Timothy P. Jurka <tpjurka@ucdavis.edu>

Examples

# LOAD LIBRARY
library(maxent)

# A DIFFERENT EXAMPLE
data(iris)
attach(iris)

x <- subset(iris, select = -Species)
y <- Species

f <- tune.maxent(x,y,nfold=3,showall=TRUE)

Results