@Test public void checkScore() throws FileNotFoundException { DataSet dat = getDataSet(basePath + "scorer/child-5000.dat"); BDeu bDeu = new BDeu(1, dat); double sk = bDeu.computeScore(0, new int[] { 6, 18}); RandomStuff.doubleEquals(-3627.0266, sk); }
@Override public double computeScore(int n) { numEvaluated++; int arity = dat.l_n_arity[n]; double a_ij = alpha; double a_ijk = alpha / arity; double skore = Gamma.lgamma(a_ij) - Gamma.lgamma(a_ij + dat.n_datapoints); for (int v = 0; v < arity; v++) { int weight = dat.row_values[n][v].length; skore += Gamma.lgamma(a_ijk + weight) - Gamma.lgamma(a_ijk); } return skore; }
BDeu extends Score { @Override public double computeScore(int n) { numEvaluated++; int arity = dat.l_n_arity[n]; double a_ij = alpha; double a_ijk = alpha / arity; double skore = Gamma.lgamma(a_ij) - Gamma.lgamma(a_ij + dat.n_datapoints); for (int v = 0; v < arity; v++) { int weight = dat.row_values[n][v].length; skore += Gamma.lgamma(a_ijk + weight) - Gamma.lgamma(a_ijk); } return skore; } }
BDeu extends Score { @Override public double computeScore(int n) { numEvaluated++; int arity = dat.l_n_arity[n]; double a_ij = alpha; double a_ijk = alpha / arity; double skore = Gamma.lgamma(a_ij) - Gamma.lgamma(a_ij + dat.n_datapoints); for (int v = 0; v < arity; v++) { int weight = dat.row_values[n][v].length; skore += Gamma.lgamma(a_ijk + weight) - Gamma.lgamma(a_ijk); } return skore; } BDeu(double alpha, DataSet dat); }
BDeu extends Score { @Override public double computeScore(int n) { numEvaluated++; int arity = dat.l_n_arity[n]; double a_ij = alpha; double a_ijk = alpha / arity; double skore = Gamma.lgamma(a_ij) - Gamma.lgamma(a_ij + dat.n_datapoints); for (int v = 0; v < arity; v++) { int weight = dat.row_values[n][v].length; skore += Gamma.lgamma(a_ijk + weight) - Gamma.lgamma(a_ijk); } return skore; } BDeu(double alpha, DataSet dat); @Override double computeScore(int n); @Override double computeScore(int n, int[] set_p, int[][] p_values); @Override String descr(); @Override double computePrediction(int n, int[] p1, int p2, Map<int[], Double> scores); }
BDeu extends Score { @Override public double computeScore(int n) { numEvaluated++; int arity = dat.l_n_arity[n]; double a_ij = alpha; double a_ijk = alpha / arity; double skore = Gamma.lgamma(a_ij) - Gamma.lgamma(a_ij + dat.n_datapoints); for (int v = 0; v < arity; v++) { int weight = dat.row_values[n][v].length; skore += Gamma.lgamma(a_ijk + weight) - Gamma.lgamma(a_ijk); } return skore; } BDeu(double alpha, DataSet dat); @Override double computeScore(int n); @Override double computeScore(int n, int[] set_p, int[][] p_values); @Override String descr(); @Override double computePrediction(int n, int[] p1, int p2, Map<int[], Double> scores);  }