AMI (Another Maxent Implementation) is a simple R implementation of multinomial logistic regression, also known as Maximum Entropy classifier. This implementation deals with binary and real-valued features and uses standard R function optim(.) to maximize the objective function. It is possible to use different iterative methods to compute lambda : BFGS, Conjugate Gradient (CG) and Generalized Iterative Scaling (GIS). This R package can be modified under the terms of the GNU GPL.

Please, note that this package has a educational objective. For an intensive and scientific use, please see the R package of Timothy P. Jurka (, which uses under the hood the MaxEnt C++ library of Tsuruoka (


maximumentropy(x, y=NULL, data=NULL, iteration=NULL,
method=c("L-BFGS-B", "GIS", "CG", "BFGS"), verbose=TRUE, normalize=FALSE)
model <- maximumentropy(Species ~ ., data=iris, iteration=100)
predict(model, new_dataset)
x <- subset(iris, select=-Species)
y <- iris$Species
model <- maximumentropy(x, y)
predicted_y <- predict(model, new_dataset)
evaluate(true_y, predicted_y)
summary(model) #summary of model
# or
model$value #final value of log-likelihood
model$lambda #computed lambda

model$levels #discrete classes Y
model$features #names of features x

model$method #name of iterative method
model$iteration #number of iterations
model$convergence #0=converged, 1=max number of iterations reached, ... (see ?optim)


fauconnier/AMI documentation built on May 16, 2019, 10:11 a.m.