Metadata-Version: 2.4
Name: multiblock-pls
Version: 1.1.0
Summary: An implementation of the most common partial least squares algorithms as multi-block methods
Home-page: https://github.com/kopeckylukas/MB-PLS
Author: Andreas Baum, Laurent Vermue, Lukas Kopecky
Author-email: <andba@dtu.dk>, <lauve@dtu.dk>, <l.kopecky22@imperial.ac.uk>
License: new BSD
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Development Status :: 5 - Production/Stable
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: numpy>=1.19.5
Requires-Dist: scipy>=1.6.0
Requires-Dist: scikit-learn>=1.6.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: matplotlib>=3.0.0
Provides-Extra: tests
Requires-Dist: pytest; extra == "tests"
Provides-Extra: docs
Requires-Dist: sphinx>=1.6; extra == "docs"
Requires-Dist: sphinx_rtd_theme; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: nbsphinx_link; extra == "docs"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

Multiblock Partial Least Squares Package
========================================


.. image:: https://img.shields.io/pypi/l/mbpls.svg
    :target: https://pypi.python.org/pypi/mbpls/
    :alt: License
.. image:: https://readthedocs.org/projects/mbpls/badge/?version=latest
    :target: https://mbpls.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status
.. image:: http://joss.theoj.org/papers/10.21105/joss.01190/status.svg
   :target: https://doi.org/10.21105/joss.01190
   :alt: JOSS Paper DOI


*This is a newly maintained version of the MBPLS software originally developed by Andreas Baum and Laurent Vermue
(homepage: https://github.com/DTUComputeStatisticsAndDataAnalysis/MBPLS/). This maintained version has been updated to be compatible with Python 3.8 and later.
Lukas Kopecky, April 2026.*

An easy to use Python package for (Multiblock) Partial Least Squares
prediction modelling of univariate or multivariate outcomes. Four state
of the art algorithms have been implemented and optimized for robust
performance on large data matrices. The package has been designed to be
able to handle missing data, such that application is straight forward
using the commonly known Scikit-learn API and its model selection
toolbox.

The documentation is available at https://mbpls.readthedocs.io
and elaborate (real-world) Jupyter Notebook examples can be found at
https://github.com/kopeckylukas/MB-PLS/tree/master/examples

This package can be cited using the following reference. 

*Baum et al., (2019). Multiblock PLS: Block dependent prediction modeling for Python. Journal of Open Source Software, 4(34), 1190*



Installation
------------

-  | Install the package for Python3 using the following command. Some
     dependencies might require an upgrade (scikit-learn, numpy and
     scipy).
   | ``$ pip install multiblock-pls``

-  | Now you can import the MBPLS class by typing
   | ``from mbpls.mbpls import MBPLS``

Quick Start
-----------

Use the mbpls package for Partial Least Squares (PLS) prediction modeling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   import numpy as np
   from mbpls.mbpls import MBPLS

   num_samples = 40
   num_features = 200

   # Generate random data matrix X
   x = np.random.rand(num_samples, num_features)

   # Generate random reference vector y
   y = np.random.rand(num_samples,1)

   # Establish prediction model using 2 latent variables (components)
   pls = MBPLS(n_components=2)
   pls.fit(x,y)
   y_pred = pls.predict(x)

The mbpls package for Multiblock Partial Least Squares (MB-PLS) prediction modeling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   import numpy as np
   from mbpls.mbpls import MBPLS

   num_samples = 40
   num_features_x1 = 200
   num_features_x2 = 250

   # Generate two random data matrices X1 and X2 (two blocks)
   x1 = np.random.rand(num_samples, num_features_x1)
   x2 = np.random.rand(num_samples, num_features_x2)

   # Generate random reference vector y
   y = np.random.rand(num_samples, 1)

   # Establish prediction model using 3 latent variables (components)
   mbpls = MBPLS(n_components=3)
   mbpls.fit([x1, x2],y)
   y_pred = mbpls.predict([x1, x2])

   # Use built-in plot method for exploratory analysis of multiblock pls models
   mbpls.plot(num_components=3)
