Skip to content

Possible update to make #362

Description

@trevorcampbell

From Hossein @ KU:

In the current version of the Python textbook, the code that computes RMSPE (using the Sacramento test data) is currently written as:

RMSPE = mean_squared_error(
    sacramento_test["price"],
    sacramento_test["predicted"]
) ** (1/2)

In recent versions of scikit‑learn (v1.4+), a dedicated function
root_mean_squared_error is available. See below. (Also the "squared=False" option is being deprecated). Using the new function avoids manual square‑rooting and future warnings:

from sklearn.metrics import root_mean_squared_error

RMSPE = root_mean_squared_error(
    sacramento_test["price"],
    sacramento_test["predicted"]
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions