/** * Adjust the bias parameter to optimize some objective function. * Note that this function only tunes the bias parameter of one class * (class of index 0), and is thus only useful for binary classification * problems. */ public void adjustBias(List<List<IN>> develData, Function<Double,Double> evalFunction, double low, double high) { LineSearcher ls = new GoldenSectionLineSearch(true,1e-2,low,high); CRFBiasedClassifierOptimizer optimizer = new CRFBiasedClassifierOptimizer(this, evalFunction); double optVal = ls.minimize(optimizer); int bi = featureIndex.indexOf(BIAS); System.err.println("Class bias of "+weights[bi][0]+" reaches optimal value "+optVal); }
/** * Adjust the bias parameter to optimize some objective function. * Note that this function only tunes the bias parameter of one class * (class of index 0), and is thus only useful for binary classification * problems. */ public void adjustBias(List<List<IN>> develData, DoubleUnaryOperator evalFunction, double low, double high) { LineSearcher ls = new GoldenSectionLineSearch(true,1e-2,low,high); CRFBiasedClassifierOptimizer optimizer = new CRFBiasedClassifierOptimizer(this, evalFunction); double optVal = ls.minimize(optimizer); int bi = featureIndex.indexOf(BIAS); log.info("Class bias of "+weights[bi][0]+" reaches optimal value "+optVal); }
public void adjustBias(List<List<IN>> develData, Function<Double,Double> evalFunction, double low, double high) { LineSearcher ls = new GoldenSectionLineSearch(true,1e-2,low,high); optimizer = new CRFBiasedClassifierOptimizer(this, evalFunction); double optVal = ls.minimize(optimizer); int bi = featureIndex.indexOf(BIAS); System.err.println("Class bias of "+weights[bi][0]+" reaches optimial value "+optVal); }
/** * Adjust the bias parameter to optimize some objective function. * Note that this function only tunes the bias parameter of one class * (class of index 0), and is thus only useful for binary classification * problems. */ public void adjustBias(List<List<IN>> develData, DoubleUnaryOperator evalFunction, double low, double high) { LineSearcher ls = new GoldenSectionLineSearch(true,1e-2,low,high); CRFBiasedClassifierOptimizer optimizer = new CRFBiasedClassifierOptimizer(this, evalFunction); double optVal = ls.minimize(optimizer); int bi = featureIndex.indexOf(BIAS); log.info("Class bias of "+weights[bi][0]+" reaches optimal value "+optVal); }