Fixing warnings in examples/impute/plot_missing_values#14148
Fixing warnings in examples/impute/plot_missing_values#14148glemaitre merged 5 commits intoscikit-learn:masterfrom rodneyosodo:warning_examples/impute/plot_missing_values
Conversation
|
Have you tried fixing the warnings before ignoring them? They can probably be avoided, which is a much better solution to ignoring the warnings. |
|
I have tried fixing the convergence warnings but it was a dead end |
|
It can be tricky to fix those warnings sometimes, but going deeper in the library and finding why you get the warning, you get a better idea of which parameters to change so that the warnings are gone :) |
|
Fixing the |
|
You cannot put the |
| import warnings | ||
| from sklearn.exceptions import ConvergenceWarning | ||
|
|
||
| warnings.filterwarnings("ignore", |
There was a problem hiding this comment.
We should avoid having to do that inside the example. Users might not understand what this is doing. It is better to fix the parameters to fix the convergence warning instead.
|
Looking more in depth. This example reveals a bug in the This issue is hidden by the Edit: |
|
FYI, the fourth feature is a categorical feature: |
|
For this PR, I would only apply the fix propose by @NicolasHug ( |
|
@0x6f736f646f Thanks for your contribution |
I was able to fix the following warning
I included the n_estimators=100 argument
{parent_dir}\sk-venv\lib\site-packages\numpy\lib\function_base.py:2530: RuntimeWarning: invalid value encountered in true_divide c /= stddev[:, None]I fixed it by ignoring the numpy warning
{parent_dir}\SK\sk-venv\lib\site-packages\sklearn\impute\_iterative.py:599: ConvergenceWarning: [IterativeImputer] Early stopping criterion not reached. " reached.", ConvergenceWarning)I fixed it by ignoring all covergence warning
related to #14117
#WiDSML
@adrinjalali