Skip to content

PLSRegression could expose an intercept_ attribute #19890

@helsharif

Description

@helsharif

Describe the bug

PLSRegression returns incorrect y_mean_ value when scale = False. In fact, the same value of y_mean_ is returned whether scale = True or = False.

Steps/Code to Reproduce

pls = PLSRegression(n_components=pls_n_components, scale=False)
pls.fit(X,Y)
pls.y_mean_ # y_mean_ will be an incorrect value.

Suggested Correction

The correct value of y_mean_ if scale=False would be given by
pls.y_mean_correct= pls.y_mean_ - np.dot(pls.x_mean_ , pls.coef_)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions