Search in sources :

Example 1 with Statistics

use of edu.cmu.tetrad.algcomparison.statistic.Statistics in project tetrad by cmu-phil.

the class TimeoutComparisonTest method getStatistics.

private static Statistics getStatistics() {
    Statistics statistics = new Statistics();
    statistics.add(new AdjacencyPrecision());
    statistics.add(new AdjacencyRecall());
    statistics.add(new ArrowheadPrecision());
    statistics.add(new ArrowheadRecall());
    statistics.add(new MathewsCorrAdj());
    statistics.add(new MathewsCorrArrow());
    statistics.add(new F1Adj());
    statistics.add(new F1Arrow());
    statistics.add(new SHD());
    statistics.add(new ElapsedTime());
    return statistics;
}
Also used : ArrowheadRecall(edu.cmu.tetrad.algcomparison.statistic.ArrowheadRecall) MathewsCorrArrow(edu.cmu.tetrad.algcomparison.statistic.MathewsCorrArrow) ArrowheadPrecision(edu.cmu.tetrad.algcomparison.statistic.ArrowheadPrecision) AdjacencyRecall(edu.cmu.tetrad.algcomparison.statistic.AdjacencyRecall) F1Arrow(edu.cmu.tetrad.algcomparison.statistic.F1Arrow) ElapsedTime(edu.cmu.tetrad.algcomparison.statistic.ElapsedTime) AdjacencyPrecision(edu.cmu.tetrad.algcomparison.statistic.AdjacencyPrecision) MathewsCorrAdj(edu.cmu.tetrad.algcomparison.statistic.MathewsCorrAdj) Statistics(edu.cmu.tetrad.algcomparison.statistic.Statistics) F1Adj(edu.cmu.tetrad.algcomparison.statistic.F1Adj) SHD(edu.cmu.tetrad.algcomparison.statistic.SHD)

Example 2 with Statistics

use of edu.cmu.tetrad.algcomparison.statistic.Statistics in project tetrad by cmu-phil.

the class TimeoutComparisonTest method testTimeoutComparison.

/**
 * Test of setComparisonGraph method, of class TimeoutComparison.
 *
 * @throws IOException
 */
@Ignore
@Test
public void testTimeoutComparison() throws IOException {
    Parameters parameters = getParameters();
    Statistics statistics = getStatistics();
    Algorithms algorithms = getAlgorithms();
    Simulations simulations = getSimulations();
    String resultsPath = tmpDir.newFolder("comparison").toString();
    TimeoutComparison comparisonEngine = getTetradComparisonEngine();
    comparisonEngine.compareFromSimulations(resultsPath, simulations, algorithms, statistics, parameters, 60, TimeUnit.SECONDS);
    System.out.println("================================================================================");
    System.out.println("Output File:");
    System.out.println("================================================================================");
    Path outputFile = Paths.get(resultsPath, "Comparison.txt");
    if (Files.exists(outputFile)) {
        try (Stream<String> stream = Files.lines(outputFile)) {
            stream.forEach(out::println);
        }
    }
    System.out.println("================================================================================");
}
Also used : Path(java.nio.file.Path) Simulations(edu.cmu.tetrad.algcomparison.simulation.Simulations) Parameters(edu.cmu.tetrad.util.Parameters) Algorithms(edu.cmu.tetrad.algcomparison.algorithm.Algorithms) Statistics(edu.cmu.tetrad.algcomparison.statistic.Statistics) System.out(java.lang.System.out) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Statistics (edu.cmu.tetrad.algcomparison.statistic.Statistics)2 Algorithms (edu.cmu.tetrad.algcomparison.algorithm.Algorithms)1 Simulations (edu.cmu.tetrad.algcomparison.simulation.Simulations)1 AdjacencyPrecision (edu.cmu.tetrad.algcomparison.statistic.AdjacencyPrecision)1 AdjacencyRecall (edu.cmu.tetrad.algcomparison.statistic.AdjacencyRecall)1 ArrowheadPrecision (edu.cmu.tetrad.algcomparison.statistic.ArrowheadPrecision)1 ArrowheadRecall (edu.cmu.tetrad.algcomparison.statistic.ArrowheadRecall)1 ElapsedTime (edu.cmu.tetrad.algcomparison.statistic.ElapsedTime)1 F1Adj (edu.cmu.tetrad.algcomparison.statistic.F1Adj)1 F1Arrow (edu.cmu.tetrad.algcomparison.statistic.F1Arrow)1 MathewsCorrAdj (edu.cmu.tetrad.algcomparison.statistic.MathewsCorrAdj)1 MathewsCorrArrow (edu.cmu.tetrad.algcomparison.statistic.MathewsCorrArrow)1 SHD (edu.cmu.tetrad.algcomparison.statistic.SHD)1 Parameters (edu.cmu.tetrad.util.Parameters)1 System.out (java.lang.System.out)1 Path (java.nio.file.Path)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1