-
Notifications
You must be signed in to change notification settings - Fork 50
/
README
104 lines (66 loc) · 3.05 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
py-causal
========
Python APIs for causal modeling algorithms developed by the University of Pittsburgh/Carnegie Mellon University [Center for Causal Discovery](http://www.ccd.pitt.edu).
This code is distributed under the LGPL 2.1 license.
Requirements:
============
Python 2.7 and 3.6
* javabridge>=1.0.11
* pandas
* numpy
* pydot
* GraphViz
* JDK 1.8
Installation overview:
======================
We have found two approaches to be useful:
* Direct python installation with pip, possibly including use of [Jupyter](http://jupyter.org/). This approach is likely best for users who have Python installed and are familiar with installing Python modules.
* Installation via [Anaconda](https://www.continuum.io/downloads), which installs Python and related utilities.
Directions for both approaches are given below...
Installation with pip
=====================
If you do not have pip installed already, try [these instructions](https://pip.pypa.io/en/stable/installing/).
Once pip is installed, execute these commands
pip install -U numpy
pip install -U pandas
pip install -U javabridge
pip install -U pydot
pip install -U GraphViz
Note: you also need to install the GraphViz engine by following [these instructions](http://www.graphviz.org/download/).
We have observed that on some OS X installations, pydot may provide the following response
Couldn't import dot_parser, loading of dot files will not be possible.
If you see this, try the following
pip uninstall pydot
pip install pyparsing==1.5.7
pip install pydot
Then, from within the py-causal directory, run the following command:
python setup.py install
or use the pip command:
pip install git+git://github.com/bd2kccd/py-causal
After running this command, enter a python shell and attempt the follwing imports:
import pandas as pd
import pydot
from pycausal import search as s
Finally, try to run the python example
python py-causal-fges-continuous-example.py
Be sure to run this from within the py-causal directory.
This program will create a file named `tetrad.svg`, which should be viewable in any SVG capable program. If you see a causal graph, everything is working correctly.
Running Jupyter/IPython
-----------------------
We have found [Jupyter](http://jupyter.org/) notebooks to be helpful. (Those who have run IPython in the past should know that Jupyter is simply a new name for IPython). To add Jupyter to your completed python install, simply run
pip -U jupyter
jupyter notebook
and then load one of the Jupyter notebooks found in this installation.
Anaconda/Jupyter
================
Installing Python with Anaconda and Jupyter may be easier for some users:
* [Download and install Anaconda](https://www.continuum.io/downloads)
Then run the following to configure anacoda
conda install javabridge
conda install pandas
conda install numpy
conda install pydot
conda install graphviz
conda install -c https://conda.anaconda.org/chirayu pycausal
jupyter notebook
and then load one of the Jupyter notebooks.