public class MaxEntModel extends Object
| Constructor and Description |
|---|
MaxEntModel()
creates a new maximum entropy model.
|
MaxEntModel(String featureFileName,
String modelFileName)
creates a new maximum entropy model, specifying files for both
the features and the resulting model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEvent(Datum d)
invoked during training to add one training Datum
d to the
training set. |
String |
bestOutcome(Datum d)
(for a trained model) returns the most likely outcome for Datum
d. |
void |
buildModel() |
int |
getNumOutcomes() |
String |
getOutcome(int i) |
double[] |
getOutcomeProbabilities(Datum d) |
void |
initializeForTraining() |
void |
initializeForTraining(String featureFileName) |
boolean |
isLoaded() |
void |
loadModel() |
void |
loadModel(BufferedReader reader) |
void |
loadModel(String modelFileName) |
double |
prob(Datum d,
String value)
(for a trained model) returns the probability that the Datum
d is classified as value. |
void |
saveModel() |
void |
saveModel(BufferedWriter writer) |
void |
saveModel(String modelFileName) |
void |
setCutoff(int cutoff)
sets the feature cutoff.
|
void |
setIterations(int iterations) |
public MaxEntModel()
public MaxEntModel(String featureFileName, String modelFileName)
featureFileName - the name of the file in which features will be
stored during trainingmodelFileName - the name of the file in which the max ent
model will be storedpublic void initializeForTraining(String featureFileName)
public void initializeForTraining()
public void addEvent(Datum d)
d to the
training set.public void setCutoff(int cutoff)
cutoff
times in the training set are ignored. Default value is 4.public void setIterations(int iterations)
public void buildModel()
public void saveModel()
public void saveModel(String modelFileName)
public void saveModel(BufferedWriter writer)
public void loadModel()
public void loadModel(String modelFileName)
public void loadModel(BufferedReader reader)
public boolean isLoaded()
public double prob(Datum d, String value)
d is classified as value.public String bestOutcome(Datum d)
d.public int getNumOutcomes()
public String getOutcome(int i)
public double[] getOutcomeProbabilities(Datum d)
Copyright © 2016 New York University. All rights reserved.