import setuptools


setuptools.setup(
    name="smb_pls",
    version="0.0.1",
    author="Giverny Robert, Ryan Gosselin",
    author_email="giverny.robert@usherbrooke.ca, ryan.gosselin@usherbrooke.ca",
    
    packages=["smb_pls"],
    description="Functions to perform SMB-PLS",
    long_description="\nFunctions to perform sequential mutiblock  PLS (SMB-PLS) modeling.\
        \n\
        \nOriginal codes developed in Matlab by Lauzon-Gauthier et al. and adapted to Python in this package.\
        \nPackage includes following functions:\
        \n-data normalization: normalisation_data, normalisation_data_val.\
        \n-block data normalization: normalisation_blocs_cal, normalisation_blocs_val.\
        \n-SMB-PLS: smbplsnipals, smbpls_cal, smbpls_exploit.\
        \n-Random-subset (RS) cross-validation: rs_cv.\
        \n-Predictive performances: VIP, BIP, CalculR, SPELimit, SPECalculation.\
        \n\
        \nLauzon-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\
        \n\
        \n\
        \n# Call function\
        \nmodel = smbpls_cal(xc,yc,bl,lv)\
        \n\
        \npredictions = smbpls_exploit(xv,yv,bl,model)\
        \n\
        \n# Input arguments\
        \n1. xc (n1,k1): X-blocks concatenated for SMB-PLS calibration.\
        \n2. yc (n1,ky): Y-block - reference values for calibration dataset.\
        \n3. xv (n2,k1): X-blocks concatenated for SMB-PLS calibration.\
        \n4. yv (n2,1): Y-block - reference values for validation dataset.\
        \n5. 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.\
        \n6. lv (n_blocks,1): Number of latent variables per block.\
        \n\
        \n# Outputs\
        \n1. model (dict): Contains the SMB-PLS model parameters, including scores, loadings and predictions.\
        \nKey entries include:\
        \n-model['ypred']: Predicted response values from SMB-PLS.\
        \n-model['Wsuper']: Super weights matrix (n_blocks, total_latent_variables).\
        \n-model['Wblock']: Block weights matrix (matrix per block).\
        \n2. predictions (dict): Contains SMB-PLS prediction results obtained by applying the model to a validation dataset.\
        \n-predictions['ypred']: Predicted response on the validation set.\
        \n\
        \n# Examples\
        \nOne full example, along with dataset is provided in folder 'tests' of 'Download Files'.\
        \n- Example 1: Grinding flotation simulator dataset (provided by Paris et al.) \
        \n\
        \n# Research using SMB-PLS: \
        \nParis, 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.\
        \n\
        \nParis, 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.\
        \n\
        \nParis, 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.\
        \n\
        \n# Compatibility\
        \nsmb_pls tested on Python 3.11 using the following modules:\
        \n- numpy 1.24.4\
        \n- matplotlib 3.10.1\
        \n- SciPy 1.15.2",
    long_description_content_type="text/markdown",
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
)