Example usage for edu.stanford.nlp.classify LinearClassifierFactory setTol

List of usage examples for edu.stanford.nlp.classify LinearClassifierFactory setTol

Introduction

In this page you can find the example usage for edu.stanford.nlp.classify LinearClassifierFactory setTol.

Prototype

public void setTol(double tol) 

Source Link

Document

Set the tolerance.

Usage

From source file:gr.aueb.cs.nlp.wordtagger.classifier.MaxEntClassifier.java

License:Open Source License

/**
 * Constructor for more parameters.//from w w  w. j  a v a2  s. c o  m
 * @param verbose, whether the classifier should log while training
 * @param maxIterations, the maximum iterations, after which the classifier should stop.
 * @param memStates, the number of previous estimate vector pairs to store
 * @param tolerance, early stopping, checking the Loss Function at every iteration,
 * and then stopping the algorithm, if it is smaller than tolerance.
 */
public MaxEntClassifier(boolean verbose, int maxIterations, int memStates, double tolerance) {
    LinearClassifierFactory<String, String> factory = new LinearClassifierFactory<>();
    factory.setTol(tolerance);
    Factory<Minimizer<DiffFunction>> minimizerCreator = customQN(verbose, maxIterations, memStates);
    factory.setMinimizerCreator(minimizerCreator);
    this.classifierFactory = factory;
}