Context[] contextComparing = objModel.evalParams.getParams(); if (this.evalParams.getParams().length != contextComparing.length) return false; for (int i = 0; i < this.evalParams.getParams().length; i++) { if (this.evalParams.getParams()[i].getOutcomes().length != contextComparing[i].getOutcomes().length) return false; for (int j = 0; i < this.evalParams.getParams()[i].getOutcomes().length; i++) { if (this.evalParams.getParams()[i].getOutcomes()[j] != contextComparing[i].getOutcomes()[j]) return false; if (this.evalParams.getParams()[i].getParameters().length != contextComparing[i].getParameters().length) return false; for (int j = 0; i < this.evalParams.getParams()[i].getParameters().length; i++) { if (this.evalParams.getParams()[i].getParameters()[j] != contextComparing[i].getParameters()[j]) return false;
public static double[] eval(int[] context, float[] values, double[] prior, EvalParameters model, boolean normalize) { Context[] params = model.getParams(); double[] activeParameters; int[] activeOutcomes;
Context[] contextComparing = objModel.evalParams.getParams(); if (this.evalParams.getParams().length != contextComparing.length) return false; for (int i = 0; i < this.evalParams.getParams().length; i++) { if (this.evalParams.getParams()[i].getOutcomes().length != contextComparing[i].getOutcomes().length) return false; for (int j = 0; i < this.evalParams.getParams()[i].getOutcomes().length; i++) { if (this.evalParams.getParams()[i].getOutcomes()[j] != contextComparing[i].getOutcomes()[j]) return false; if (this.evalParams.getParams()[i].getParameters().length != contextComparing[i].getParameters().length) return false; for (int j = 0; i < this.evalParams.getParams()[i].getParameters().length; i++) { if (this.evalParams.getParams()[i].getParameters()[j] != contextComparing[i].getParameters()[j]) return false;
public static double[] eval(int[] context, float[] values, double[] prior, EvalParameters model, boolean normalize) { Context[] params = model.getParams(); double[] activeParameters; int[] activeOutcomes;
/** * Provides the fundamental data structures which encode the maxent model * information. This method will usually only be needed by * GISModelWriters. The following values are held in the Object array * which is returned by this method: * * <li>index 0: opennlp.maxent.Context[] containing the model * parameters * <li>index 1: java.util.Map containing the mapping of model predicates * to unique integers * <li>index 2: java.lang.String[] containing the names of the outcomes, * stored in the index of the array which represents their * unique ids in the model. * <li>index 3: java.lang.Integer containing the value of the models * correction constant * <li>index 4: java.lang.Double containing the value of the models * correction parameter * * @return An Object[] with the values as described above. */ public final Object[] getDataStructures() { Object[] data = new Object[5]; data[0] = evalParams.getParams(); data[1] = pmap; data[2] = outcomeNames; data[3] = (int) evalParams.getCorrectionConstant(); data[4] = evalParams.getCorrectionParam(); return data; } }
/** * Provides the fundamental data structures which encode the maxent model * information. This method will usually only be needed by * GISModelWriters. The following values are held in the Object array * which is returned by this method: * * <li>index 0: opennlp.maxent.Context[] containing the model * parameters * <li>index 1: java.util.Map containing the mapping of model predicates * to unique integers * <li>index 2: java.lang.String[] containing the names of the outcomes, * stored in the index of the array which represents their * unique ids in the model. * <li>index 3: java.lang.Integer containing the value of the models * correction constant * <li>index 4: java.lang.Double containing the value of the models * correction parameter * * @return An Object[] with the values as described above. */ public final Object[] getDataStructures() { Object[] data = new Object[5]; data[0] = evalParams.getParams(); data[1] = pmap; data[2] = outcomeNames; data[3] = (int) evalParams.getCorrectionConstant(); data[4] = evalParams.getCorrectionParam(); return data; } }
Context[] params = model.getParams(); int numfeats[] = new int[model.getNumOutcomes()]; int[] activeOutcomes;
Context[] params = model.getParams(); int numfeats[] = new int[model.getNumOutcomes()]; int[] activeOutcomes;