Skip to contents

Tells Mossy Forest which Python installation to use for its backend. Call this once at the start of each R session before using mf with backend = "python". The pure R backend does not need it.

Usage

mf_setup(python = NULL, condaenv = NULL, virtualenv = NULL)

Arguments

python

Path to a Python binary. Passed to reticulate::use_python().

condaenv

Name of a conda environment. Passed to reticulate::use_condaenv().

virtualenv

Path to a virtual environment. Passed to reticulate::use_virtualenv().

Value

Invisible NULL.

Details

The Python environment must have scikit-learn, shap, and numpy installed. Example setup:


  conda create -n sfenv python=3.11
  conda activate sfenv
  pip install scikit-learn shap numpy

Examples

if (FALSE) { # \dontrun{
  mf_setup(condaenv = "sfenv")
  mf_setup(python = "/usr/local/bin/python3")
} # }