Skip to main content

Consult the module API page at

https://engineering.purdue.edu/kak/distPLS/PartialLeastSquares-1.0.4.html

for all information related to this module, including that related to the latest changes to the code. The page at the URL shown above lists all of the module functionality you can invoke in your own code.

You may need this module if (1) you are trying to make multidimensional predictions from multidimensional observations; (2) the dimensionality of the observation space is large; and (3) the data you have available for constructing a prediction model is rather limited. The more traditional multiple linear regression (MLR) algorithms are likely to become numerically unstable under these conditions.

In addition to presenting an implementation of the main Partial Least Squares (PLS) algorithm that can be used to make a multidimensional prediction from a multidimensional observation, this module also includes what is known as the PLS1 algorithm for the case when the predicted entity is just one-dimensional (as in, say, face recognition in computer vision).

Typical usage syntax:

In the notation that is typically used for describing PLS, X
denotes the matrix formed by multidimensional observations, with
each row of X standing for the values taken by all the predictor
variables.  And Y denotes the matrix formed by the values for the
predicted variables. Each row of Y corresponds to the prediction
that can be made on the basis of the corresponding row of X.  Let's
say that you have some previously collected data for the X and Y
matrices in the form of CSV records in disk files. Given these X
and Y, you would want to calculate the matrix B of regression
coefficients with this module.  Toward that end, you can make the
following calls in your script:

    import PartialLeastSquares as PLS

    XMatrix_file = "X_data.csv"
    YMatrix_file = "Y_data.csv"

    pls = PLS.PartialLeastSquares(
            XMatrix_file =  XMatrix_file,
            YMatrix_file =  YMatrix_file,
            epsilon      = 0.0001,
          )
   pls.get_XMatrix_from_csv()
   pls.get_YMatrix_from_csv()
   B = pls.PLS()

The object B returned by the last call will be a numpy matrix
consisting of the calculated regression coefficients.  Let's say
that you now have a matrix Xtest of new data for the predictor
variables.  All you have to do to calculate the values for the
predicted variables is

   Ytest  =  (Xtest - pls.mean0X) * B  +  pls.mean0Y

where pls.mean0X is the column-wise mean of the X matrix and
pls.mean0Y the same for the Y matrix.

Metadata

Release files for PartialLeastSquares 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PartialLeastSquares 1.0.4
File Size Uploaded Provenance
PartialLeastSquares-1.0.4.tar.gz 1.3 MB Without provenance Details

Release files / PartialLeastSquares-1.0.4.tar.gz

Download URL PartialLeastSquares-1.0.4.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
963545bf5b5a8d3def958ed017718e97c1387b1a649293da395108c07f328e8a
BLAKE2b-256 checksum
How to use checksums
405bf482386cd6e0ff0ea7e20e8793ab5aff40ef7608482ec854f249c9839876
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.2

Security for PartialLeastSquares 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file No provenance

1.0.2

1.0.1

1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page