use of edu.cmu.tetrad.algcomparison.score.SemBicScore in project tetrad by cmu-phil.
the class TestSimulatedFmri2 method TestCycles_Data_fMRI_FASK.
public void TestCycles_Data_fMRI_FASK() {
Parameters parameters = new Parameters();
parameters.set("penaltyDiscount", 8);
parameters.set("depth", -1);
parameters.set("faskDelta", -0.2);
parameters.set("twoCycleAlpha", 1e-15);
parameters.set("numRuns", 60);
// parameters.set("randomSelectionSize", 1);
parameters.set("Structure", "Placeholder");
Statistics statistics = new Statistics();
statistics.add(new ParameterColumn("Structure"));
statistics.add(new AdjacencyPrecision());
statistics.add(new AdjacencyRecall());
// statistics.add(new MathewsCorrAdj());
statistics.add(new ArrowheadPrecision());
statistics.add(new ArrowheadRecall());
statistics.add(new TwoCyclePrecision());
statistics.add(new TwoCycleRecall());
statistics.add(new TwoCycleFalsePositive());
statistics.add(new TwoCycleFalseNegative());
statistics.add(new TwoCycleTruePositive());
statistics.add(new ElapsedTime());
statistics.setWeight("AHR", 1.0);
statistics.setWeight("2CP", 1.0);
statistics.setWeight("2CR", 1.0);
statistics.setWeight("2CFP", 1.0);
Simulations simulations = new Simulations();
String dir = "/Users/user/Downloads/CyclesTestingData/";
String subdir = "data_fslfilter_concat";
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network1_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network2_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network3_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network4_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_cont_p3n7", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_cont_p7n3", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network6_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network6_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network7_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network7_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network8_amp_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network8_amp_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network8_cont_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network9_amp_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network9_amp_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network9_cont_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Diamond", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Markov_Complex_1", subdir));
Algorithms algorithms = new Algorithms();
algorithms.add(new edu.cmu.tetrad.algcomparison.algorithm.multi.Fask(new SemBicScore()));
//
Comparison comparison = new Comparison();
comparison.setShowAlgorithmIndices(true);
comparison.setShowSimulationIndices(true);
comparison.setSortByUtility(false);
comparison.setShowUtilities(false);
comparison.setParallelized(false);
comparison.setSaveGraphs(false);
comparison.setTabDelimitedTables(false);
comparison.setSaveGraphs(true);
String directory = "comparison_testing_nonconcat";
comparison.compareFromSimulations(directory, simulations, algorithms, statistics, parameters);
}
use of edu.cmu.tetrad.algcomparison.score.SemBicScore in project tetrad by cmu-phil.
the class TestSimulatedFmri method task.
private void task(boolean testing) {
Parameters parameters = new Parameters();
parameters.set("penaltyDiscount", 4);
parameters.set("depth", -1);
parameters.set("twoCycleAlpha", 1e-10);
parameters.set("faskDelta", -.2);
parameters.set("reverseOrientationsBySignOfCorrelation", false);
parameters.set("reverseOrientationsBySkewnessOfVariables", false);
parameters.set("numRuns", 10);
parameters.set("randomSelectionSize", 10);
parameters.set("Structure", "Placeholder");
Statistics statistics = new Statistics();
statistics.add(new ParameterColumn("Structure"));
statistics.add(new AdjacencyPrecision());
statistics.add(new AdjacencyRecall());
// statistics.add(new MathewsCorrAdj());
statistics.add(new ArrowheadPrecision());
statistics.add(new ArrowheadRecall());
statistics.add(new TwoCyclePrecision());
statistics.add(new TwoCycleRecall());
statistics.add(new TwoCycleFalsePositive());
statistics.add(new TwoCycleFalseNegative());
statistics.add(new TwoCycleTruePositive());
statistics.add(new ElapsedTime());
statistics.setWeight("AHR", 1.0);
statistics.setWeight("2CP", 1.0);
statistics.setWeight("2CR", 1.0);
statistics.setWeight("2CFP", 1.0);
Simulations simulations = new Simulations();
if (!testing) {
String dir = "/Users/user/Downloads/Cycles_Data_fMRI/";
String subdir = "data_fslfilter";
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network1_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network2_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network3_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network4_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_contr", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_contr_p2n6", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_contr_p6n2", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network6_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network6_contr", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network7_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network7_contr", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network8_amp_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network8_amp_contr", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network8_contr_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network9_amp_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network9_amp_contr", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network9_contr_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Diamond", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Markov_Complex_1", subdir));
} else {
String dir = "/Users/user/Downloads/CyclesTestingData/";
String subdir = "data_fslfilter";
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network1_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network2_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network3_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network4_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_cont_p3n7", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network5_cont_p7n3", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network6_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network6_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network7_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network7_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network8_amp_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network8_amp_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network8_cont_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network9_amp_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network9_amp_cont", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Network9_cont_amp", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Diamond", subdir));
simulations.add(new LoadContinuousDataAndSingleGraph(dir + "Markov_Complex_1", subdir));
}
Algorithms algorithms = new Algorithms();
algorithms.add(new FaskConcatenated(new SemBicScore()));
// algorithms.add(new FaskGfciConcatenated(new SemBicTest()));
// algorithms.add(new FasLofsConcatenated(Lofs2.Rule.RSkew));
Comparison comparison = new Comparison();
comparison.setShowAlgorithmIndices(true);
comparison.setShowSimulationIndices(true);
comparison.setSortByUtility(false);
comparison.setShowUtilities(false);
comparison.setParallelized(false);
comparison.setSaveGraphs(false);
comparison.setTabDelimitedTables(false);
comparison.setSaveGraphs(true);
String directory;
if (!testing) {
directory = "comparison_training";
} else {
directory = "comparison_testing";
}
comparison.compareFromSimulations(directory, simulations, algorithms, statistics, parameters);
}
Aggregations