use of edu.cmu.tetrad.algcomparison.score.SemBicScore in project tetrad by cmu-phil.
the class TimeoutComparisonTest method getAlgorithms.
private static Algorithms getAlgorithms() {
Algorithms algorithms = new Algorithms();
algorithms.add(new Gfci(new FisherZ(), new SemBicScore()));
return algorithms;
}
use of edu.cmu.tetrad.algcomparison.score.SemBicScore in project tetrad by cmu-phil.
the class TsImages method search.
@Override
public Graph search(List<DataModel> dataSets, Parameters parameters) {
List<DataModel> dataModels = new ArrayList<>();
for (DataModel dataSet : dataSets) {
dataModels.add(dataSet);
}
TsGFci search;
if (score instanceof SemBicScore) {
SemBicScoreImages gesScore = new SemBicScoreImages(dataModels);
gesScore.setPenaltyDiscount(parameters.getDouble("penaltyDiscount"));
IndependenceTest test = new IndTestScore(gesScore);
search = new TsGFci(test, gesScore);
} else if (score instanceof BdeuScore) {
double samplePrior = parameters.getDouble("samplePrior", 1);
double structurePrior = parameters.getDouble("structurePrior", 1);
BdeuScoreImages score = new BdeuScoreImages(dataModels);
score.setSamplePrior(samplePrior);
score.setStructurePrior(structurePrior);
IndependenceTest test = new IndTestScore(score);
search = new TsGFci(test, score);
} else {
throw new IllegalStateException("Sorry, data must either be all continuous or all discrete.");
}
IKnowledge knowledge = dataModels.get(0).getKnowledge();
search.setKnowledge(knowledge);
return search.search();
}
use of edu.cmu.tetrad.algcomparison.score.SemBicScore in project tetrad by cmu-phil.
the class ExampleCompareSimulation method main.
public static void main(String... args) {
Parameters parameters = new Parameters();
https: parameters.set("numRuns", 10);
parameters.set("numMeasures", 100);
parameters.set("avgDegree", 4, 6);
parameters.set("sampleSize", 500);
parameters.set("alpha", 1e-4, 1e-3, 1e-2);
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());
statistics.setWeight("AP", 1.0);
statistics.setWeight("AR", 0.5);
Algorithms algorithms = new Algorithms();
algorithms.add(new Pc(new FisherZ()));
algorithms.add(new Cpc(new FisherZ(), new Fges(new SemBicScore(), false)));
algorithms.add(new PcStable(new FisherZ()));
algorithms.add(new CpcStable(new FisherZ()));
Simulations simulations = new Simulations();
simulations.add(new SemSimulation(new RandomForward()));
Comparison comparison = new Comparison();
comparison.setShowAlgorithmIndices(true);
comparison.setShowSimulationIndices(true);
comparison.setSortByUtility(true);
comparison.setShowUtilities(true);
comparison.setParallelized(true);
comparison.compareFromSimulations("comparison", simulations, algorithms, statistics, parameters);
}
use of edu.cmu.tetrad.algcomparison.score.SemBicScore in project tetrad by cmu-phil.
the class ExampleCompareSimulationTimeSeries method main.
public static void main(String... args) {
Parameters parameters = new Parameters();
parameters.set("numRuns", 10);
parameters.set("numMeasures", 10);
parameters.set("avgDegree", 4);
parameters.set("sampleSize", 500);
parameters.set("alpha", 1e-4, 1e-3, 1e-2);
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());
statistics.setWeight("AP", 1.0);
statistics.setWeight("AR", 0.5);
Algorithms algorithms = new Algorithms();
algorithms.add(new TsFci(new FisherZ()));
algorithms.add(new TsGfci(new FisherZ(), new SemBicScore()));
algorithms.add(new TsImages(new SemBicScore()));
Simulations simulations = new Simulations();
simulations.add(new TimeSeriesSemSimulation(new RandomForward()));
Comparison comparison = new Comparison();
comparison.setSortByUtility(true);
comparison.setShowUtilities(true);
comparison.compareFromSimulations("comparison", simulations, algorithms, statistics, parameters);
}
use of edu.cmu.tetrad.algcomparison.score.SemBicScore in project tetrad by cmu-phil.
the class TsImagesSemBic method getParameters.
@Override
public List<String> getParameters() {
List<String> parameters = new Fges(new SemBicScore(), false).getParameters();
parameters.add("randomSelectionSize");
// Bootstrapping
parameters.add("bootstrapSampleSize");
parameters.add("bootstrapEnsemble");
parameters.add("verbose");
return parameters;
}
Aggregations