I tried to import the function root_mean_squared_log_error
from sklearn.metrics
like this:
from sklearn.metrics import root_mean_squared_log_error
However, it shows
"root_mean_squared_log_error" is unknown import symbol
My versions of sklearn, python interpreter and Pylance are v1.4.2, v3.12.2 64-bit and v2024.4.1 respectively.
First I checked if this function is explicitly defined by entering the __init__.py
file of sklearn.metrics
, and I can see it is imported from _regression
which contains the definition.
Then I copied all the functions imported from _regression
to my own file, like this:
from sklearn.metrics import (
d2_absolute_error_score,
d2_pinball_score,
...
r2_score,
root_mean_squared_error,
root_mean_squared_log_error,
)
Only the last two ones can not be recognized, which are new in version 1.4. So I am wondering if I am doing something wrong with these functions with the newest version(stable).
Note: My Code works just fine(can be compiled and executed normally), and this error is incurred by Pylance(reportAttributeAccessIssue).
ducati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.