Record Class QNTrainer.ModelEvaluator
java.lang.Object
java.lang.Record
opennlp.tools.ml.maxent.quasinewton.QNTrainer.ModelEvaluator
- Record Components:
indexer- A validDataIndexerinstance.
- All Implemented Interfaces:
QNMinimizer.Evaluator
- Enclosing class:
QNTrainer
private static record QNTrainer.ModelEvaluator(DataIndexer indexer)
extends Record
implements QNMinimizer.Evaluator
For measuring model's training accuracy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DataIndexerThe field for theindexerrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateModelEvaluator(DataIndexer indexer) Creates an instance of aModelEvaluatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleevaluate(double[] parameters) Evaluate the current model on training data setfinal inthashCode()Returns a hash code value for this object.indexer()Returns the value of theindexerrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
indexer
The field for theindexerrecord component.
-
-
Constructor Details
-
ModelEvaluator
Creates an instance of aModelEvaluatorrecord class.- Parameters:
indexer- the value for theindexerrecord component
-
-
Method Details
-
evaluate
public double evaluate(double[] parameters) Evaluate the current model on training data set- Specified by:
evaluatein interfaceQNMinimizer.Evaluator- Parameters:
parameters- The parameters used for training.- Returns:
- model's training accuracy
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
indexer
-