@Test public void testRankerScore() throws Exception { String sc = basePath + "scorer/diabetes/5/"; String ph1 = sc + "heu.scores"; String ph2 = sc + "seq.scores"; ParentSet[][] sc1 = RandomStuff.getScoreReader(ph1, 1); ParentSet[][] sc2 = RandomStuff.getScoreReader(ph2, 1); RankerScores ranker = new RankerScores(); ranker.debug = 2; System.out.println("\n" + ranker.execute(sc1, sc2)); }
public int execute(ParentSet[][] f_psets, ParentSet[][] s_psets) throws Exception { if (f_psets.length != s_psets.length) { log.info("Different number of variables!"); return 0; } int n = f_psets.length; double f = 0; double s = 0; for (int v = 0; v < n; v++) { int len = Math.min(f_psets[v].length, s_psets[v].length); ParentSet[] f1 = new ParentSet[len]; ParentSet[] s1 = new ParentSet[len]; System.arraycopy(f_psets[v], 0, f1, 0, len); System.arraycopy(s_psets[v], 0, s1, 0, len); Pair<Double, Double> res = compare(f1, s1); if (res.getFirst() > res.getSecond()) { f += 1; } else if (res.getSecond() > res.getFirst()) { s += 1; } else { f += 0.5; s += 0.5; } if (debug > 1) { System.out.printf("%d - f: %.1f, s: %.1f\n", v, res.getFirst(), res.getSecond()); } } if (debug > 0) { } int f1 = (int) Math.floor(f); int s1 = (int) Math.floor(s); return 0; }
RankerScores { public int execute(ParentSet[][] f_psets, ParentSet[][] s_psets) throws Exception { if (f_psets.length != s_psets.length) { log.info("Different number of variables!"); return 0; } int n = f_psets.length; double f = 0; double s = 0; for (int v = 0; v < n; v++) { int len = Math.min(f_psets[v].length, s_psets[v].length); ParentSet[] f1 = new ParentSet[len]; ParentSet[] s1 = new ParentSet[len]; System.arraycopy(f_psets[v], 0, f1, 0, len); System.arraycopy(s_psets[v], 0, s1, 0, len); Pair<Double, Double> res = compare(f1, s1); if (res.getFirst() > res.getSecond()) { f += 1; } else if (res.getSecond() > res.getFirst()) { s += 1; } else { f += 0.5; s += 0.5; } if (debug > 1) { System.out.printf("%d - f: %.1f, s: %.1f\n", v, res.getFirst(), res.getSecond()); } } if (debug > 0) { } int f1 = (int) Math.floor(f); int s1 = (int) Math.floor(s); return 0; } }
RankerScores { public int execute(ParentSet[][] f_psets, ParentSet[][] s_psets) throws Exception { if (f_psets.length != s_psets.length) { log.info("Different number of variables!"); return 0; } int n = f_psets.length; double f = 0; double s = 0; for (int v = 0; v < n; v++) { int len = Math.min(f_psets[v].length, s_psets[v].length); ParentSet[] f1 = new ParentSet[len]; ParentSet[] s1 = new ParentSet[len]; System.arraycopy(f_psets[v], 0, f1, 0, len); System.arraycopy(s_psets[v], 0, s1, 0, len); Pair<Double, Double> res = compare(f1, s1); if (res.getFirst() > res.getSecond()) { f += 1; } else if (res.getSecond() > res.getFirst()) { s += 1; } else { f += 0.5; s += 0.5; } if (debug > 1) { System.out.printf("%d - f: %.1f, s: %.1f\n", v, res.getFirst(), res.getSecond()); } } if (debug > 0) { } int f1 = (int) Math.floor(f); int s1 = (int) Math.floor(s); return 0; }  }
RankerScores { public int execute(ParentSet[][] f_psets, ParentSet[][] s_psets) throws Exception { if (f_psets.length != s_psets.length) { log.info("Different number of variables!"); return 0; } int n = f_psets.length; double f = 0; double s = 0; for (int v = 0; v < n; v++) { int len = Math.min(f_psets[v].length, s_psets[v].length); ParentSet[] f1 = new ParentSet[len]; ParentSet[] s1 = new ParentSet[len]; System.arraycopy(f_psets[v], 0, f1, 0, len); System.arraycopy(s_psets[v], 0, s1, 0, len); Pair<Double, Double> res = compare(f1, s1); if (res.getFirst() > res.getSecond()) { f += 1; } else if (res.getSecond() > res.getFirst()) { s += 1; } else { f += 0.5; s += 0.5; } if (debug > 1) { System.out.printf("%d - f: %.1f, s: %.1f\n", v, res.getFirst(), res.getSecond()); } } if (debug > 0) { } int f1 = (int) Math.floor(f); int s1 = (int) Math.floor(s); return 0; }  int execute(ParentSet[][] f_psets, ParentSet[][] s_psets); Pair<Double, Double> compare(ParentSet[] f_pset, ParentSet[] s_pset); }
RankerScores { public int execute(ParentSet[][] f_psets, ParentSet[][] s_psets) throws Exception { if (f_psets.length != s_psets.length) { log.info("Different number of variables!"); return 0; } int n = f_psets.length; double f = 0; double s = 0; for (int v = 0; v < n; v++) { int len = Math.min(f_psets[v].length, s_psets[v].length); ParentSet[] f1 = new ParentSet[len]; ParentSet[] s1 = new ParentSet[len]; System.arraycopy(f_psets[v], 0, f1, 0, len); System.arraycopy(s_psets[v], 0, s1, 0, len); Pair<Double, Double> res = compare(f1, s1); if (res.getFirst() > res.getSecond()) { f += 1; } else if (res.getSecond() > res.getFirst()) { s += 1; } else { f += 0.5; s += 0.5; } if (debug > 1) { System.out.printf("%d - f: %.1f, s: %.1f\n", v, res.getFirst(), res.getSecond()); } } if (debug > 0) { } int f1 = (int) Math.floor(f); int s1 = (int) Math.floor(s); return 0; }  int execute(ParentSet[][] f_psets, ParentSet[][] s_psets); Pair<Double, Double> compare(ParentSet[] f_pset, ParentSet[] s_pset); public double alpha; public int debug; }