Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] deprecated mean_squared_error #2551

Open
quant12345 opened this issue Oct 2, 2024 · 4 comments
Open

[Question] deprecated mean_squared_error #2551

quant12345 opened this issue Oct 2, 2024 · 4 comments
Labels
question Further information is requested

Comments

@quant12345
Copy link
Contributor

Hello everyone!

I would like to correct the following warning: FutureWarning: 'squared' is deprecated in version 1.4 and will be removed in 1.6. To calculate the root mean squared error, use the function'root_mean_squared_error'.

In the tests build (3.8, all) the version is scikit-learn-1.3.2. 'root_mean_squared_error' appeared in scikit-learn-1.4.

Question: Do you plan to upgrade scikit-learn to 1.4(in builds 3.8)?
Code processing depends on this.

@quant12345 quant12345 added the triage Issue waiting for triaging label Oct 2, 2024
@madtoinou
Copy link
Collaborator

Hi @quant12345,

Since Python 3.8 is reaching its end of support at the end of the month, we are planning on doing one last release for it. Once this is done, we will be able to focus on things such as fixing some warning/deprecation messages, remove the version capping on numpy and simplify the typing imports/synthax.

If you want to contribute to darts, I would recommend checking the issues labeled with the good first issue or pr welcomed :)

@madtoinou madtoinou added question Further information is requested and removed triage Issue waiting for triaging labels Oct 3, 2024
@quant12345
Copy link
Contributor Author

quant12345 commented Oct 3, 2024

Considering that after scikit-learn-1.3.2 the next version is 1.4.0, it seems to me that it would be more appropriate to try to switch to scikit-learn-1.4.0 (if possible).
And the next release of scikit-learn, judging by the chronology, will probably be 1.6 (I'm not exactly sure), where squared will be removed.

Of course, I can do scikit-learn version processing and depending on the version choose mean_squared_error, {"squared": False} or root_mean_squared_error. But then if you switch to 1.4.0, there will be unnecessary lines of code with version checking that will need to be removed (that is, changing the code again).

@madtoinou
Copy link
Collaborator

madtoinou commented Oct 3, 2024

Hi @quant12345,

Since there is no cap on scikit-learn's version as you can see here, you are actually free to use another version. I just checked the environment that I am using to work with darts and it's actually relying on scikit-learn 1.4.1.

You can safely ignore the warning, we will make sure to solve it before the release of scikit-learn 1.6 (it's not a priority yet, we already have similar messages for pandas that we started to address).

@quant12345
Copy link
Contributor Author

quant12345 commented Oct 3, 2024

I looked in scikit-learn 1.4.0 supports Python versions 3.9 to 3.12. I locally replaced "squared": False from mean_squared_error to root_mean_squared_error and the tests pass without warning:

pytest darts/tests/metrics/test_metrics.py::TestMetrics::test_metrics_deterministic[config10]
pytest darts/tests/metrics/test_metrics.py::TestMetrics::test_metrics_deterministic[config17]

Thank @madtoinou for the detailed answers, I understand how to do this PR.

I'll try to study the good first issue again. Most of what I found concerned statistics, which I don't know that well. I fixed everything I could in the summer :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants