use of edu.cmu.tetrad.algcomparison.algorithm.multi.Fask in project tetrad by cmu-phil.
the class SpecialExampleSimulationClark method main.
public static void main(String... args) {
Parameters parameters = new Parameters();
parameters.set("numRuns", 20);
parameters.set("sampleSize", 1000);
parameters.set("twoCycleAlpha", 1);
Statistics statistics = new Statistics();
statistics.add(new AdjacencyPrecision());
statistics.add(new AdjacencyRecall());
statistics.add(new ArrowheadPrecision());
statistics.add(new ArrowheadRecall());
// statistics.add(new TwoCycleTruePositive());
// statistics.add(new TwoCycleFalseNegative());
// statistics.add(new TwoCycleFalsePositive());
// For randomm forward graph
parameters.set("numMeasures", 10);
parameters.set("numLatents", 0);
parameters.set("avgDegree", 2);
parameters.set("maxDegree", 100);
parameters.set("maxIndegree", 100);
parameters.set("maxOutdegree", 100);
parameters.set("connected", false);
//
// statistics.setWeight("AP", 1.0);
// statistics.setWeight("AR", 0.5);
Algorithms algorithms = new Algorithms();
algorithms.add(new Fask());
Simulations simulations = new Simulations();
// simulations.add(new SpecialDataClark(new SpecialGraphClark()));
simulations.add(new SpecialDataClark(new RandomForward()));
Comparison comparison = new Comparison();
comparison.setShowAlgorithmIndices(true);
comparison.setShowSimulationIndices(true);
comparison.setSortByUtility(false);
comparison.setShowUtilities(false);
comparison.setParallelized(true);
comparison.setSaveGraphs(true);
comparison.setSavePatterns(true);
comparison.setSavePags(true);
// comparison.saveToFiles("comparison", new SpecialDataClark(new SpecialGraphClark()), parameters);
comparison.compareFromSimulations("comparison", simulations, algorithms, statistics, parameters);
}
use of edu.cmu.tetrad.algcomparison.algorithm.multi.Fask in project tetrad by cmu-phil.
the class FaskGraphs method loadFiles.
private void loadFiles(String path, Parameters parameters, String... contains) {
DataReader reader = new DataReader();
reader.setVariablesSupplied(true);
reader.setDelimiter(DelimiterType.TAB);
File dir = new File(path);
File[] files = dir.listFiles();
if (files == null) {
throw new NullPointerException();
}
FILE: for (File file : files) {
String name = file.getName();
for (String s : contains) {
if (!name.contains(s))
continue FILE;
}
if (!name.contains("graph")) {
try {
if (name.contains("autistic")) {
types.add(true);
DataSet dataSet = reader.parseTabular(new File(path, name));
filenames.add(name);
datasets.add(dataSet);
Fask fask = new Fask();
Graph search = fask.search(dataSet, parameters);
graphs.add(search);
} else if (name.contains("typical")) {
types.add(false);
DataSet dataSet = reader.parseTabular(new File(path, name));
filenames.add(name);
datasets.add(dataSet);
Fask fask = new Fask();
Graph search = fask.search(dataSet, parameters);
graphs.add(search);
}
System.out.println("Loaded " + name);
} catch (IOException e) {
System.out.println("File " + name + " could not be parsed.");
}
}
}
reconcileNames();
}
Aggregations