Installation¶
The prfmodel package is currently only available as a development version that must be installed from GitHub. Please note that this version is still under active development and subject to constant change. Installing prfmodel requires Python version >= 3.10 and <= 3.13.
Installing the development version¶
To clone the development version of prfmodel from the GitHub repository:
git clone git@github.com:popylar-org/prfmodel.git
cd prfmodel
We recommend installing prfmodel in a virtual environment to prevent conflicts with other packages, for example using venv.
python -m venv my_venv # Create a virtual environment called 'my_venv'
my_venv\Scripts\activate.bat # Activate the virtual environment
python -m venv my_venv # Create a virtual environment called 'my_venv'
source my_venv/bin/activate # Activate the virtual environment
prfmodel relies on Keras to enable users to use different backends for model fitting. Currently, users can choose between three backends: TensorFlow, PyTorch, and JAX. If you don’t know which backend to choose, we recommend to start with TensorFlow. At least one backend must be installed to use prfmodel.
To install the development version of prfmodel from the local clone of the repository with a backend:
python -m pip install .[tensorflow]
python -m pip install .[torch]
python -m pip install .[jax]
The default backend in Keras is Tensorflow, but this can be changed by setting the KERAS_BACKEND environment
variable, for example, at the beginning of a Python script or Jupyter notebook:
import os
os.environ["KERAS_BACKEND"] = "jax"
import prfmodel
Important: The backend must be set before importing prfmodel or keras. See the Keras documentation for details.
Installing dependencies for package development¶
For those who want to contribute to the package development, you can make an editable install of the package and install all required additional dependencies via:
git clone git@github.com:popylar-org/prfmodel.git
cd prfmodel
pip install -e .[dev]