Package opennlp.tools.ml.model
Klasse AbstractModel
java.lang.Object
opennlp.tools.ml.model.AbstractModel
- Alle implementierten Schnittstellen:
MaxentModel
- Bekannte direkte Unterklassen:
GISModel,NaiveBayesModel,PerceptronModel,QNModel
A basic
MaxentModel implementation.-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungAbstractModel(Context[] params, String[] predLabels, String[] outcomeNames) Initializes anAbstractModel. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanfinal StringgetAllOutcomes(double[] ocs) Retrieves a string matching all the outcome names with all the probabilities produced by theMaxentModel.eval(String[])method.final StringgetBestOutcome(double[] ocs) Return the name of the outcome corresponding to the highest likelihood in the parameter ocs.final Object[]Provides the fundamental data structures which encode the maxent model information.intRetrieves the index associated with the String name of the given outcome.intfinal StringgetOutcome(int i) Retrieves the String name of the outcome associated with the indexi.inthashCode()Von Klasse geerbte Methoden java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden opennlp.tools.ml.model.MaxentModel
eval, eval, eval
-
Konstruktordetails
-
AbstractModel
Initializes anAbstractModel.- Parameter:
params- Theparametersto set.predLabels- The predicted labels.outcomeNames- The names of the outcomes.
-
-
Methodendetails
-
getBestOutcome
Return the name of the outcome corresponding to the highest likelihood in the parameter ocs.- Angegeben von:
getBestOutcomein SchnittstelleMaxentModel- Parameter:
ocs- A double[] as returned by the eval(String[] context) method.- Gibt zurück:
- The name of the most likely outcome.
-
getModelType
- Gibt zurück:
- Retrieves the
AbstractModel.ModelType.
-
getAllOutcomes
Retrieves a string matching all the outcome names with all the probabilities produced by theMaxentModel.eval(String[])method.- Angegeben von:
getAllOutcomesin SchnittstelleMaxentModel- Parameter:
ocs- Adouble[]as returned by theMaxentModel.eval(String[])method.- Gibt zurück:
- String containing outcome names paired with the normalized
probability (contained in the
double[] ocs) for each one.
-
getOutcome
Beschreibung aus Schnittstelle kopiert:MaxentModelRetrieves the String name of the outcome associated with the indexi.- Angegeben von:
getOutcomein SchnittstelleMaxentModel- Parameter:
i- An outcome id.- Gibt zurück:
- Retrieves the name of the outcome associated with that id.
-
getIndex
Beschreibung aus Schnittstelle kopiert:MaxentModelRetrieves the index associated with the String name of the given outcome.- Angegeben von:
getIndexin SchnittstelleMaxentModel- Parameter:
outcome- The String name of the outcome for which the index is desired.- Gibt zurück:
- Retrieves the index if the given
outcomelabel exists for this model,-1if it does not.
-
getNumOutcomes
public int getNumOutcomes()- Angegeben von:
getNumOutcomesin SchnittstelleMaxentModel- Gibt zurück:
- Retrieves the number of outcomes for this model.
-
getDataStructures
Provides the fundamental data structures which encode the maxent model information. Note: This method will usually only be needed byGIS model writers.The following values are held in the Object array which is returned by this method:
- Gibt zurück:
- An
Objectarray with the values as described above.
-
hashCode
public int hashCode() -
equals
-