Metadata-Version: 2.4
Name: smb_pls
Version: 0.0.1
Summary: Functions to perform SMB-PLS
Author: Giverny Robert, Ryan Gosselin
Author-email: giverny.robert@usherbrooke.ca, ryan.gosselin@usherbrooke.ca
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: summary


Functions to perform sequential mutiblock  PLS (SMB-PLS) modeling.        
        
Original codes developed in Matlab by Lauzon-Gauthier et al. and adapted to Python in this package.        
Package includes following functions:        
-data normalization: normalisation_data, normalisation_data_val.        
-block data normalization: normalisation_blocs_cal, normalisation_blocs_val.        
-SMB-PLS: smbplsnipals, smbpls_cal, smbpls_exploit.        
-Random-subset (RS) cross-validation: rs_cv.        
-Predictive performances: VIP, BIP, CalculR, SPELimit, SPECalculation.        
        
Lauzon-Gauthier, J., Manolescu, P., & Duchesne, C. (2018). The Sequential Multi-block PLS algorithm (SMB-PLS): Comparison of performance and interpretability. Chemometrics and Intelligent Laboratory Systems, 180(May), 72–83. https://doi.org/10.1016/j.chemolab.2018.07.005        
        
        
# Call function        
model = smbpls_cal(xc,yc,bl,lv)        
        
predictions = smbpls_exploit(xv,yv,bl,model)        
        
# Input arguments        
1. xc (n1,k1): X-blocks concatenated for SMB-PLS calibration.        
2. yc (n1,ky): Y-block - reference values for calibration dataset.        
3. xv (n2,k1): X-blocks concatenated for SMB-PLS calibration.        
4. yv (n2,1): Y-block - reference values for validation dataset.        
5. bl (list of lists): List of variable indices for each X block. Each sublist corresponds to a block and contains the indices of its variables in the global X-matrix.        
6. lv (n_blocks,1): Number of latent variables per block.        
        
# Outputs        
1. model (dict): Contains the SMB-PLS model parameters, including scores, loadings and predictions.        
Key entries include:        
-model['ypred']: Predicted response values from SMB-PLS.        
-model['Wsuper']: Super weights matrix (n_blocks, total_latent_variables).        
-model['Wblock']: Block weights matrix (matrix per block).        
2. predictions (dict): Contains SMB-PLS prediction results obtained by applying the model to a validation dataset.        
-predictions['ypred']: Predicted response on the validation set.        
        
# Examples        
One full example, along with dataset is provided in folder 'tests' of 'Download Files'.        
- Example 1: Grinding flotation simulator dataset (provided by Paris et al.)         
        
# Research using SMB-PLS:         
Paris, A., Duchesne, C., & Poulin, É. (2021). Establishing multivariate specification regions for incoming raw materials using projection to latent structure models: comparison between direct mapping and model inversion. Frontiers in Analytical Science, 1(November), 1–15. https://doi.org/10.3389/frans.2021.729732.        
        
Paris, A., Duchesne, C., & Poulin, É. (2024). Adjusting plant operating conditions to widen multivariate specification regions for incoming raw materials – An optimization framework. Chemometrics and Intelligent Laboratory Systems, 244(September 2023). https://doi.org/10.1016/j.chemolab.2023.104991.        
        
Paris, A., Duchesne, C., & Poulin, É. (2024). Improving profitability of continuous processes facing raw material variability through data-driven SMB-PLS model-based adaptive control. Computers and Chemical Engineering, 184(October 2023). https://doi.org/10.1016/j.compchemeng.2024.108615.        
        
# Compatibility        
smb_pls tested on Python 3.11 using the following modules:        
- numpy 1.24.4        
- matplotlib 3.10.1        
- SciPy 1.15.2
