plspy is a Partial Least Squares package developed to replicate and extend the PLS MATLAB package created by Randy McIntosh, et al for use in neuroimaging applications.
Check out the documentation for plspy at https://plspy.readthedocs.io/en/latest/
To install the latest version of plspy, clone the repository and install the package from source:
git clone https://github.com/McIntosh-Lab/plspy.git
cd plspy
python3 -m venv plspy-env
source plspy-env/bin/activate
python -m pip install -e .
python -m pip install -r requirements.txt
All methods require:
X: 2D data matrix. Rows should be ordered as subject within condition within group.groups: list with the number of subjects per group (e.g., [10, 10])num_conditions: integer specifying the number of conditions
Mean-Centred Task PLS:
>>> result = plspy.PLS(X, [10, 10], num_conditions=3, mctype=0, num_perm=500, num_boot=500, num_split=500, lv=1, CI=0.95, pls_method="mct")
Behavioural PLS:
>>> result = plspy.PLS(X, [10, 10], num_conditions=3, Y=Y, pls_method="rb")
Contrast Task PLS:
>>> result = plspy.PLS(X, [10, 10], num_conditions=3, contrasts=C, pls_method="cst")
Contrast Behavioural PLS:
>>> result = plspy.PLS(X, [10, 10], num_conditions=3, Y=Y, contrasts=C, pls_method="csb")
Multiblock PLS:
>>> result = plspy.PLS(X, [10, 10], num_conditions=3, Y=Y, mctype=0, bscan=[1,2], pls_method="mb")
Contrast Multiblock PLS:
>>> result = plspy.PLS(X, [10, 10], num_conditions=3, Y=Y, mctype=0, bscan=[1,2], pls_method="cmb")
To see documentation on additional arguments and fields available, see https://plspy.readthedocs.io/en/latest/index.html. Alternatively,
call help() on a specific PLS method by typing the following in a Python interpreter:
>>> import plspy
>>> help(plspy.methods["<methodname>"])
Where <method> is the string of one of the PLS versions shown below.
Available methods:
-
"mct" - Mean-Centred Task PLS
-
"rb" - Regular Behaviour PLS
-
"cst" - Contrast Task PLS
-
"csb" - Contrast Behaviour PLS
-
"mb" - Multiblock PLS
-
"cmb" - Contrast Multiblock PLS