Skip to content

Commit

Permalink
Merge pull request #1587 from cmu-phil/development
Browse files Browse the repository at this point in the history
v7.3.4
  • Loading branch information
jdramsey authored Apr 13, 2023
2 parents 3961e15 + e46656b commit 1770bd7
Show file tree
Hide file tree
Showing 166 changed files with 700 additions and 696 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You will need to set up Java on your machine. For setting up Java, see our Wiki

To download the current jar you can use to launch the Tetrad GUI, click this link:

https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/tetrad-gui/7.3.0/tetrad-gui-7.3.0-launch.jar.
https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/tetrad-gui/7.3.3/tetrad-gui-7.3.3-launch.jar.

You may be able to launch this jar by double clicking the jar file name, though on a Mac, this presents
some [security challenges](https://github.com/cmu-phil/tetrad/wiki/Dealing-with-Tetrad-on-a-Mac:--Security-Issues). In
Expand Down
2 changes: 1 addition & 1 deletion data-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad</artifactId>
<version>7.3.3</version>
<version>7.3.4</version>
</parent>
<!-- <groupId>io.github.cmu-phil</groupId>-->
<artifactId>data-reader</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad</artifactId>
<version>7.3.3</version>
<version>7.3.4</version>
<packaging>pom</packaging>

<name>Tetrad Project</name>
Expand Down
2 changes: 1 addition & 1 deletion tetrad-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad</artifactId>
<version>7.3.3</version>
<version>7.3.4</version>
</parent>

<artifactId>tetrad-gui</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package edu.cmu.tetradapp.editor;

import edu.cmu.tetrad.algcomparison.algorithm.Algorithm;
import edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.PAG_SAMPLING_RFCI;
import edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.RFCI_BSC;
import edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.PagSampleRfci;
import edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.RfciBsc;
import edu.cmu.tetrad.algcomparison.utils.TakesIndependenceWrapper;
import edu.cmu.tetrad.algcomparison.utils.UsesScoreWrapper;
import edu.cmu.tetrad.annotation.Score;
Expand Down Expand Up @@ -74,7 +74,7 @@ public void addToPanel(GeneralAlgorithmRunner algorithmRunner) {
Parameters parameters = algorithmRunner.getParameters();

// Hard-coded parameter groups for Rfci-Bsc
if (algorithm instanceof RFCI_BSC) {
if (algorithm instanceof RfciBsc) {
// Phase one: PAG and constraints candidates Searching
String title = algorithm
.getClass().getAnnotation(edu.cmu.tetrad.annotation.Algorithm.class).name();
Expand Down Expand Up @@ -107,7 +107,7 @@ public void addToPanel(GeneralAlgorithmRunner algorithmRunner) {
this.mainPanel.add(createSubPanel(title, params, parameters));
this.mainPanel.add(Box.createVerticalStrut(10));

} else if (algorithm instanceof PAG_SAMPLING_RFCI) {
} else if (algorithm instanceof PagSampleRfci) {
String title = algorithm.getClass().getAnnotation(edu.cmu.tetrad.annotation.Algorithm.class).name();

Set<String> params = new LinkedHashSet<>();
Expand All @@ -118,13 +118,13 @@ public void addToPanel(GeneralAlgorithmRunner algorithmRunner) {

title = "RFCI Parameters";
params.clear();
params.addAll(PAG_SAMPLING_RFCI.RFCI_PARAMETERS);
params.addAll(PagSampleRfci.RFCI_PARAMETERS);
this.mainPanel.add(createSubPanel(title, params, parameters));
this.mainPanel.add(Box.createVerticalStrut(10));

title = "Probabilistic Test Parameters";
params.clear();
params.addAll(PAG_SAMPLING_RFCI.PROBABILISTIC_TEST_PARAMETERS);
params.addAll(PagSampleRfci.PROBABILISTIC_TEST_PARAMETERS);
this.mainPanel.add(createSubPanel(title, params, parameters));
this.mainPanel.add(Box.createVerticalStrut(10));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ private List<Statistic> statistics() {
statistics.add(new ArrowheadRecall());
statistics.add(new ArrowheadPrecisionCommonEdges());
statistics.add(new ArrowheadRecallCommonEdges());
statistics.add(new AdjacencyTN());
statistics.add(new AdjacencyTP());
statistics.add(new AdjacencyTPR());
statistics.add(new AdjacencyFPR());
statistics.add(new AdjacencyFN());
statistics.add(new AdjacencyFP());
statistics.add(new AdjacencyFN());
statistics.add(new ArrowheadTN());
statistics.add(new ArrowheadTP());
statistics.add(new AdjacencyTn());
statistics.add(new AdjacencyTp());
statistics.add(new AdjacencyTpr());
statistics.add(new AdjacencyFpr());
statistics.add(new AdjacencyFn());
statistics.add(new AdjacencyFp());
statistics.add(new AdjacencyFn());
statistics.add(new ArrowheadTn());
statistics.add(new ArrowheadTp());
statistics.add(new F1Adj());
statistics.add(new F1All());
statistics.add(new F1Arrow());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import edu.cmu.tetrad.algcomparison.algorithm.Algorithm;
import edu.cmu.tetrad.algcomparison.algorithm.AlgorithmFactory;
import edu.cmu.tetrad.algcomparison.algorithm.oracle.cpdag.SINGLE_GRAPH_ALG;
import edu.cmu.tetrad.algcomparison.algorithm.oracle.cpdag.SingleGraphAlg;
import edu.cmu.tetrad.algcomparison.utils.HasKnowledge;
import edu.cmu.tetrad.algcomparison.utils.TakesExternalGraph;
import edu.cmu.tetrad.annotation.*;
Expand Down Expand Up @@ -391,7 +391,7 @@ public Algorithm getAlgorithmFromInterface(AlgorithmModel algoModel, Independenc

// Those pairwise algos (R3, RShew, Skew..) require source graph to initialize - Zhou
if (algorithm != null && algorithm instanceof TakesExternalGraph && this.algorithmRunner.getSourceGraph() != null && !this.algorithmRunner.getDataModelList().isEmpty()) {
Algorithm externalGraph = new SINGLE_GRAPH_ALG(this.algorithmRunner.getSourceGraph());
Algorithm externalGraph = new SingleGraphAlg(this.algorithmRunner.getSourceGraph());
((TakesExternalGraph) algorithm).setExternalGraph(externalGraph);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void execute() {
} else if (dataSet.isDiscrete()) {
double samplePrior = getParams().getDouble("samplePrior", 1);
double structurePrior = getParams().getDouble("structurePrior", 1);
BDeuScore score = new BDeuScore(dataSet);
BdeuScore score = new BdeuScore(dataSet);
score.setSamplePrior(samplePrior);
score.setStructurePrior(structurePrior);
this.fges = new Fges(score);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import edu.cmu.tetrad.algcomparison.algorithm.Algorithm;
import edu.cmu.tetrad.algcomparison.algorithm.MultiDataSetAlgorithm;
import edu.cmu.tetrad.algcomparison.algorithm.cluster.CLUSTER_ALGORITHM;
import edu.cmu.tetrad.algcomparison.algorithm.cluster.ClusterAlgorithm;
import edu.cmu.tetrad.algcomparison.independence.DSeparationTest;
import edu.cmu.tetrad.algcomparison.independence.IndependenceWrapper;
import edu.cmu.tetrad.algcomparison.independence.TakesGraph;
Expand Down Expand Up @@ -316,7 +316,7 @@ public void execute() {

graphList.add(((MultiDataSetAlgorithm) algo).search(sub, this.parameters));
}
} else if (getAlgorithm() instanceof CLUSTER_ALGORITHM) {
} else if (getAlgorithm() instanceof ClusterAlgorithm) {
for (int k = 0; k < this.parameters.getInt("numRuns"); k++) {
getDataModelList().forEach(dataModel -> {
if (dataModel instanceof ICovarianceMatrix) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import edu.cmu.tetrad.algcomparison.algorithm.Algorithm;
import edu.cmu.tetrad.algcomparison.algorithm.AlgorithmFactory;
import edu.cmu.tetrad.algcomparison.algorithm.oracle.cpdag.FGES;
import edu.cmu.tetrad.algcomparison.algorithm.oracle.cpdag.Fges;
import edu.cmu.tetrad.algcomparison.score.ConditionalGaussianBicScore;
import edu.cmu.tetrad.data.DataModel;
import edu.cmu.tetrad.graph.Graph;
Expand Down Expand Up @@ -71,7 +71,7 @@ public static void main(String[] args) throws Exception {
//Algorithm fges = AlgorithmFactory.create(Fges.class, null, BdeuScore.class);

// for mixed data can use Conditional Gaussian
Algorithm fges = AlgorithmFactory.create(FGES.class, null, ConditionalGaussianBicScore.class);
Algorithm fges = AlgorithmFactory.create(Fges.class, null, ConditionalGaussianBicScore.class);


// Set algorithm parameters
Expand Down
2 changes: 1 addition & 1 deletion tetrad-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.cmu-phil</groupId>
<artifactId>tetrad</artifactId>
<version>7.3.3</version>
<version>7.3.4</version>
</parent>

<artifactId>tetrad-lib</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package edu.cmu.tetrad.algcomparison.algorithm;

import edu.cmu.tetrad.algcomparison.algorithm.oracle.cpdag.SINGLE_GRAPH_ALG;
import edu.cmu.tetrad.algcomparison.algorithm.oracle.cpdag.SingleGraphAlg;
import edu.cmu.tetrad.algcomparison.independence.IndependenceWrapper;
import edu.cmu.tetrad.algcomparison.score.ScoreWrapper;
import edu.cmu.tetrad.algcomparison.utils.TakesExternalGraph;
Expand Down Expand Up @@ -69,7 +69,7 @@ public static Algorithm create(Class<? extends Algorithm> algoClass, Independenc
throws IllegalAccessException, InstantiationException {
Algorithm algorithm = AlgorithmFactory.create(algoClass, test, score);
if (externalGraph != null && algorithm instanceof TakesExternalGraph) {
((TakesExternalGraph) algorithm).setExternalGraph(new SINGLE_GRAPH_ALG(externalGraph));
((TakesExternalGraph) algorithm).setExternalGraph(new SingleGraphAlg(externalGraph));
}

return algorithm;
Expand All @@ -91,7 +91,7 @@ public static Algorithm create(Class<? extends Algorithm> algoClass, Class<? ext
throws IllegalAccessException, InstantiationException {
Algorithm algorithm = AlgorithmFactory.create(algoClass, indTestClass, scoreClass);
if (externalGraph != null && algorithm instanceof TakesExternalGraph) {
((TakesExternalGraph) algorithm).setExternalGraph(new SINGLE_GRAPH_ALG(externalGraph));
((TakesExternalGraph) algorithm).setExternalGraph(new SingleGraphAlg(externalGraph));
}

return algorithm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
algoType = AlgType.search_for_structure_over_latents
)
@Bootstrapping
public class BPC implements Algorithm, HasKnowledge, CLUSTER_ALGORITHM {
public class Bpc implements Algorithm, HasKnowledge, ClusterAlgorithm {

static final long serialVersionUID = 23L;
private Knowledge knowledge = new Knowledge();

public BPC() {
public Bpc() {
}

@Override
Expand Down Expand Up @@ -105,7 +105,7 @@ public Graph search(DataModel dataSet, Parameters parameters) {
return fullGraph;
}
} else {
BPC algorithm = new BPC();
Bpc algorithm = new Bpc();

DataSet data = (DataSet) dataSet;
GeneralResamplingTest search = new GeneralResamplingTest(data, algorithm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
*
* @author jdramsey
*/
public interface CLUSTER_ALGORITHM {
public interface ClusterAlgorithm {
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
algoType = AlgType.search_for_structure_over_latents
)
@Bootstrapping
public class FOFC implements Algorithm, HasKnowledge, CLUSTER_ALGORITHM {
public class Fofc implements Algorithm, HasKnowledge, ClusterAlgorithm {

static final long serialVersionUID = 23L;
private Knowledge knowledge = new Knowledge();

public FOFC() {
public Fofc() {
}

@Override
Expand Down Expand Up @@ -116,7 +116,7 @@ public Graph search(DataModel dataSet, Parameters parameters) {
return fullGraph;
}
} else {
FOFC algorithm = new FOFC();
Fofc algorithm = new Fofc();

DataSet data = (DataSet) dataSet;
GeneralResamplingTest search = new GeneralResamplingTest(data, algorithm, parameters.getInt(Params.NUMBER_RESAMPLING), parameters.getDouble(Params.PERCENT_RESAMPLE_SIZE), parameters.getBoolean(Params.RESAMPLING_WITH_REPLACEMENT), parameters.getInt(Params.RESAMPLING_ENSEMBLE), parameters.getBoolean(Params.ADD_ORIGINAL_DATASET));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
algoType = AlgType.search_for_structure_over_latents
)
@Bootstrapping
public class FTFC implements Algorithm, HasKnowledge, CLUSTER_ALGORITHM {
public class Ftfc implements Algorithm, HasKnowledge, ClusterAlgorithm {

static final long serialVersionUID = 23L;
private Knowledge knowledge = new Knowledge();

public FTFC() {
public Ftfc() {
}

@Override
Expand Down Expand Up @@ -65,7 +65,7 @@ public Graph search(DataModel dataSet, Parameters parameters) {

return search.search();
} else {
FTFC algorithm = new FTFC();
Ftfc algorithm = new Ftfc();

DataSet data = (DataSet) dataSet;
GeneralResamplingTest search = new GeneralResamplingTest(data, algorithm, parameters.getInt(Params.NUMBER_RESAMPLING), parameters.getDouble(Params.PERCENT_RESAMPLE_SIZE), parameters.getBoolean(Params.RESAMPLING_WITH_REPLACEMENT), parameters.getInt(Params.RESAMPLING_ENSEMBLE), parameters.getBoolean(Params.ADD_ORIGINAL_DATASET));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
)
@Bootstrapping
@Experimental
public class LING implements Algorithm {
public class Ling implements Algorithm {

static final long serialVersionUID = 23L;

Expand All @@ -47,7 +47,7 @@ public Graph search(DataModel dataSet, Parameters parameters) {
return new EdgeListGraph();
}
} else {
LING algorithm = new LING();
Ling algorithm = new Ling();

DataSet data = (DataSet) dataSet;
GeneralResamplingTest search = new GeneralResamplingTest(data, algorithm, parameters.getInt(Params.NUMBER_RESAMPLING), parameters.getDouble(Params.PERCENT_RESAMPLE_SIZE), parameters.getBoolean(Params.RESAMPLING_WITH_REPLACEMENT), parameters.getInt(Params.RESAMPLING_ENSEMBLE), parameters.getBoolean(Params.ADD_ORIGINAL_DATASET));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
)
@Bootstrapping
//@Experimental
public class LINGAM implements Algorithm {
public class Lingam implements Algorithm {

static final long serialVersionUID = 23L;

Expand All @@ -42,7 +42,7 @@ public Graph search(DataModel dataSet, Parameters parameters) {
lingam.setFastIcaTolerance(parameters.getDouble(Params.FAST_ICA_TOLERANCE));
return lingam.search(SimpleDataLoader.getContinuousDataSet(dataSet));
} else {
LINGAM algorithm = new LINGAM();
Lingam algorithm = new Lingam();

DataSet data = (DataSet) dataSet;
GeneralResamplingTest search = new GeneralResamplingTest(data, algorithm, parameters.getInt(Params.NUMBER_RESAMPLING), parameters.getDouble(Params.PERCENT_RESAMPLE_SIZE), parameters.getBoolean(Params.RESAMPLING_WITH_REPLACEMENT), parameters.getInt(Params.RESAMPLING_ENSEMBLE), parameters.getBoolean(Params.ADD_ORIGINAL_DATASET));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
algoType = AlgType.produce_undirected_graphs
)
@Bootstrapping
public class MGM implements Algorithm {
public class Mgm implements Algorithm {

static final long serialVersionUID = 23L;

public MGM() {
public Mgm() {
}

@Override
Expand Down Expand Up @@ -84,11 +84,11 @@ public Graph search(DataModel ds, Parameters parameters) {
mgmParam3
};

edu.pitt.csb.mgm.MGM m = new edu.pitt.csb.mgm.MGM(_ds, lambda);
edu.pitt.csb.mgm.Mgm m = new edu.pitt.csb.mgm.Mgm(_ds, lambda);

return m.search();
} else {
MGM algorithm = new MGM();
Mgm algorithm = new Mgm();

DataSet data = (DataSet) ds;
GeneralResamplingTest search = new GeneralResamplingTest(data, algorithm, parameters.getInt(Params.NUMBER_RESAMPLING), parameters.getDouble(Params.PERCENT_RESAMPLE_SIZE), parameters.getBoolean(Params.RESAMPLING_WITH_REPLACEMENT), parameters.getInt(Params.RESAMPLING_ENSEMBLE), parameters.getBoolean(Params.ADD_ORIGINAL_DATASET));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
* @author jdramsey
*/
@Bootstrapping
public class CCD_MAX_CONCATENATED implements MultiDataSetAlgorithm, HasKnowledge {
public class CcdMaxConcatenated implements MultiDataSetAlgorithm, HasKnowledge {
static final long serialVersionUID = 23L;
private Knowledge knowledge = new Knowledge();
private final IndependenceWrapper test;

public CCD_MAX_CONCATENATED(IndependenceWrapper test) {
public CcdMaxConcatenated(IndependenceWrapper test) {
this.test = test;
}

Expand All @@ -56,7 +56,7 @@ public Graph search(List<DataModel> dataModels, Parameters parameters) {
search.setUseOrientTowardDConnections(parameters.getBoolean(Params.ORIENT_TOWARD_DCONNECTIONS));
return search.search();
} else {
CCD_MAX_CONCATENATED algorithm = new CCD_MAX_CONCATENATED(this.test);
CcdMaxConcatenated algorithm = new CcdMaxConcatenated(this.test);

List<DataSet> dataSets = new ArrayList<>();

Expand Down Expand Up @@ -88,7 +88,7 @@ public Graph search(DataModel dataSet, Parameters parameters) {
if (parameters.getInt(Params.NUMBER_RESAMPLING) < 1) {
return search(Collections.singletonList(SimpleDataLoader.getContinuousDataSet(dataSet)), parameters);
} else {
CCD_MAX_CONCATENATED algorithm = new CCD_MAX_CONCATENATED(this.test);
CcdMaxConcatenated algorithm = new CcdMaxConcatenated(this.test);

List<DataSet> dataSets = Collections.singletonList(SimpleDataLoader.getContinuousDataSet(dataSet));
GeneralResamplingTest search = new GeneralResamplingTest(dataSets,
Expand Down
Loading

0 comments on commit 1770bd7

Please sign in to comment.