Skip to content

Installation

Joshua Levy edited this page Dec 11, 2019 · 6 revisions

To install InteractionTransformer, you must have a working installation of either Python 3.6+ or R 3.5+.

Installation for Python:

Here, we recommend a conda installation: https://www.anaconda.com/

Then, create a new environment or use an old one:

conda create -n interaction_transform_environ python=3.7
conda activate interaction_transform_environ 

Install the package via the command:

pip install interactiontransformer

Any missing dependencies should be solvable through either anaconda or by installing them via PyPI as issues come up. Please post on our issues page.

Installation with R

For now, our package is installable via GitHub. First, you must install devtools:

install.packages('devtools')

Then, install reticulate via:

install.packages('reticulate')

Finally, install the package using:

devtools::install_github("jlevy44/interactiontransformer")

Alternatively:

library(devtools)
install_github("jlevy44/interactiontransformer")

If the package is available on CRAN, install InteractionTransformer via:

install.packages('interactiontransformer')

However, this will not link the InteractionTransformer code to the R distribution. To link this, there are a few options. First, verify that InteractionTransformer has been installed to a PyPI or anaconda environment on your computer (see instructions above). Another way to install the package is to run the following:

library(interactiontransformer)
install_transformer()

Then, you need to locate that Python distribution to source it such that packages. We recommend making sure R has access to the systems anaconda distribution where the python package is installed:

reticulate:::conda_list(conda = "auto")

This finds where each of the anaconda environments are located. Sourcing this python environment can be achieved with:

library(interactiontransformer)
source.python('/anaconda2/envs/py36/bin/python')
interactiontransformer<-import_transformer()

Where "/anaconda2/envs/py36/bin/python" is my python path that points to the Python package.

Now that the packages are loaded, let's load some data and get testing!