Coder Social home page Coder Social logo

py-tetrad's Introduction

py-tetrad

Please visit our Tetrad web page for current links for downloadables, a list of contributors, some history, documentation, descriptions, links for our various projects, Javadocs, and more.

This package shows how to make arbitrary code in Tetrad directly available in Python via JPype as part of a Python workflow. We do this by giving some tools for translating graphs and dataset from Python to Java and back, proving some reusable examples of how it can be done, and giving API Javadoc documentation to allow further exploration of the entire Tetrad codebase.

It also gives a class, TetradSearch.py can be used in both Python and R to hide the JPype facilities for those who don't want to (or can't, in the case of R) deal directly with the Tetrad codebase.

You can also integrate Tetrad code into Python by making os.system (..) calls to Causal Command; here are some examples of how to do it. For R functionality, see rpy-tetrad, which is located in a subdirectory of the py-tetrad project in GitHub.

Please bear with us as we add and refine example modules and keep our code current. Please submit any problems or suggestions to our Issue Tracker, so that we can resolve them. Sometimes it may not be obvious how to call a Tetrad class or method from Python. Please point out any difficulties you have, so we can make it more intuitive for the next version.

We maintain a current version of the Tetrad launch jar, which is either the current published version or else the current published version with some adjustments. We will make sure that the example code will work with this current jar. Feel free to use any version of Tetrad though. All artifacts for Tetrad for the last several releases are on Maven Central, with their corresponding API Javadocs, along wth signatures to verify authenticity.

News

2024-1-26

  • Updated jar to Tetrad version 7.6.2.
  • Updated Javadocs to version 7.6.2.
  • Added methods in TetradSearch.py to run the Markov checker in Tetrad.
  • Added pseudoinverse options to relevant scores and tests in TetradSearch.py.

Install

  1. It is necessary to have a JDK installed for version 17+. See our Wiki article, Setting up Java for Tetrad.

  2. type echo $JAVA_HOMEin a terminal to see if this is already set to your JDK. On Windows, it should already be set if you've installed Java. On Mac, it should be set to the latest JDK installed. If it's not set, you'll need to set JAVA_HOME to the path of the Java installation you want to use for py-tetrad.

  3. It is also necessary (for JPype) to have Python 3.5+ installed. Here is how to update Python if you need to.

  4. We use the JPype package to interface Python with Java. For installation instructions, see the Docs for the JPype box.

  5. Finally, you will need to clone this GitHub repository, so if you don't have Git installed, google and install that for your machine type.

Then (for instance, on a Mac) in a terminal window, cd to a directory where you want the cloned project to appear and type the following--again, as above, make sure JAVA_HOME is set correctly to your java path:

git clone https://github.com/cmu-phil/py-tetrad/
cd py-tetrad/pytetrad
python run_continuous.py

If everything is set up right, the last command should cause this example module to run various algorithms in Tetrad and print out result graphs. Feel free to explore other example modules in that directory.

Feel free to use your favorite method for editing and running modules.

Citation

Please cite as:

Bryan Andrews and Joseph Ramsey. https://github.com/cmu-phil/py-tetrad, 2023.

py-tetrad's People

Contributors

jdramsey avatar bja43 avatar tiagodsilva avatar yasu-sh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.