This library provides a C++ class to execute Partial Least Squares (PLS) NIPALS method for a scalar response variable for both dimension reduction or regression. It provides a class composed of methods to build, load, and store a PLS model, project feature vectors onto the PLS model and retrieve its low dimensional representation.

PLS handles data in high dimensional feature spaces and can be employed as a dimensionality reduction technique. PLS is a powerful technique that provides dimensionality reduction for even hundreds of thousands of variables, considering the response variable in the process. The latter point is in contrast to traditional dimensionality reduction techniques such as Principal Component Analysis (PCA).

The implementation of the NIPALS algorithm provided in this library is a translation from the MATLAB version of the NIPALS algorithm written by Dr. Hervé Abdi from The University of Texas at Dallas. This code requires OpenCV version 1.0 or superior.

If you find bugs or problems in this software or you have suggestions to improve or make it more user friendly, please send an e-mail to williamrobschwartz [at]

This implementation has been used as part of the human detector approach developed by Schwartz et al. [4]. We kindly ask you to cite that reference upon the use of this code with the following bibtex entry.


Schwartz, W. R.; Kembhavi, A.; Harwood, D.; Davis, L. S. (2009): Human Detection Using Partial Least Squares Analysis. In: IEEE International Conference on Computer Vision (ICCV), pp. 24-31, 2009, (oral presentation).


The members of the C++ classes and examples regarding how to execute the PLS NIPALS are provided in the documentation manual [pdf].


This code works either on Windows or on Linux. For Windows, a project for Visual Studio 2005 is provided. A Makefile can be used to compile all files and generate an executable main containing examples of usage. To incorporate this library in your project, copy every .cpp and .h file to your directory and compile them with your code. Then call the methods provided by the class Model. A Matlab implementation for PLS written by Dr. Hervé Abdi, from University of Texas at Dallas, can be found here.

filename size OS 523KB