PLS regression is a Regression method that takes into account the latent structure in both datasets. Partial least squares regression performed well in MRI-based assessments for both single-label and multi-label learning reasons. PLSRegression acquires from PLS with mode=”A” and deflation_mode=”regression”. Additionally, known PLS2 or PLS in the event of a one-dimensional response.
Syntax: class sklearn.cross_decomposition.PLSRegression(n_components=2, *, scale=True, max_iter=500, tol=1e-06, copy=True)
This function accepts five parameters which are mentioned above and defined below:
- n_components:<int>: Its default value is 2, and it accepts the number of components that are needed to keep.
- scale:<bool>: Its default value is True, and it accepts whether to scale the data or not.
- max_iteran :<int>: Its default value is 500, and it accepts the maximum number of iteration of the NIPALS inner loop.
- tol: <non-negative real>: Its default value is 1e-06, and it accepts tolerance used in the iterative algorithm.
- copy:<bool>: Its default value is True, and it shows that deflection should be done on a copy. Don’t care about side effects when the default value is set True.
Return Value: PLSRegression is an approach for predicting response.
The below Example illustrates the use of the PLSRegression() Model.
Plot the Predicted value using PLSRegression
Print the predicted value using trained model
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.