Skip to content

MLPRegressor - Validation score wrongly defined #24411

Open
@ducvinh-nguyen

Description

@ducvinh-nguyen

Describe the bug

In MLPRegressor, if the option early_stopping is set as True, the model will monitor the loss calculated on the validation set in stead of the training set, using the same loss formulation which is the mean squared error. However, as implemented in the line 719 in the source code:

self.validation_scores_.append(self.score(X_val, y_val))

The function "score", which returns (to confirm) the coefficient of determination, is used. This is not correct. It should be something like:

self.validation_scores_.append(mean_squared_error(self.predict(X_val), y_val))

Steps/Code to Reproduce

Sorry, I don't have time to write a simple code. But the error is quite clear.

Expected Results

The validation score must be mean squared error.

Actual Results

Coefficient of determination

Versions

1.1.1

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