⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uniformprior.java

📁 最大熵分类器
💻 JAVA
字号:
package opennlp.maxent;/** * Provide a maximum entropy model with a uniform prior. * @author Tom Morton * */public class UniformPrior implements Prior {  private int numOutcomes;  private double r;      public void logPrior(double[] dist, int[] context, float[] values) {    for (int oi=0;oi<numOutcomes;oi++) {      dist[oi] = r;    }  }    public void logPrior(double[] dist, int[] context) {    logPrior(dist,context,null);  }  public void setLabels(String[] outcomeLabels, String[] contextLabels) {    this.numOutcomes = outcomeLabels.length;    r = Math.log(1.0/numOutcomes);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -