List of usage examples for edu.stanford.nlp.classify LinearClassifierFactory setTol
public void setTol(double tol)
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; }