Talip7/scikit-learn-issues-multilabel huggingface dataset:
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
@Ben3940 Go ahead. I do not see anyone working on that file.

Labels: good first issue, module:test-suite, Meta-issue
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
Hello, I would like to work on sklearn/utils/tests/test_validation.py if no one is working on it

Labels: good first issue, module:test-suite, Meta-issue
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
@adamgonzo Go ahead. I do not see anyone working on that file.

Labels: good first issue, module:test-suite, Meta-issue
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
@adamgonzo I'm working on the utils folder. However, feel free to work on that file

Labels: good first issue, module:test-suite, Meta-issue
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
MR suggested for `sklearn/tests/test_pipeline.py`

Labels: good first issue, module:test-suite, Meta-issue
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
I will start working on `sklearn/tests/test_base.py`

Labels: good first issue, module:test-suite, Meta-issue
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
I can work on ```sklearn/tests/test_discriminant_analysis.py```, I did not find any other pull requests on that

Labels: good first issue, module:test-suite, Meta-issue
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
I can work on https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tests/test_isotonic.py

Labels: good first issue, module:test-suite, Meta-issue
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
Hey @thomasjpfan I'm a first-time contributor, could you please review my changes? Thank you so much.

Labels: good first issue, module:test-suite, Meta-issue
pytest warnings due to deprecation of pytest.warns(None)

Pytest issues warnings about using `pytest.warns(None)` context manager, where the `None` part is now being deprecated. 

For example,
```>>> pytest ./sklearn/tests/test_naive_bayes.py ```
results in `79 passed, 4 warnings`. After commenting out `--disable-pytest-warnings` key in `[tool:pytest]` section of `setup.cfg`, I could see that _some_ of the warnings are:

> PytestRemovedIn8Warning: Passing None has been deprecated.
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

Apparently, `pytest.warns(None)` is deprecated for being widely misunderstood. I think that while sklearn's tests do _not_ suffer from this misunderstanding, they might be affected in the future if and when pytest raises an error instead of a deprecation warning. (I couldn't figure out if this is planned for pytest's future releases, but in any case, avoiding the deprecation and reducing the warnings count won't harm.)

I found [this message ](https://github.com/pytest-dev/pytest/issues/9404#issuecomment-991051965), which is relevant to how `pytest.warns(None)` is used in scikit-learn tests, and how this could be changed. I opened this issue to share this information and quote the message, as it may save someone time in the future.

> The tests were of the form:
> 
> ```
> with pytest.warns(None) as record:
>     <do some stuff>
>     <check record for warnings, and possibly raise an error>
> ```
> 
> The tests were not assuming that the pytest context code would raise an error if a warning occurred. Instead, these tests were doing their own error checking based on `record`. So they were really using `pytest.warns(None)` exactly like `warnings.catch_warnings(record=True)`. (There is a [pull request](https://github.com/scipy/scipy/pull/15192) to make the change to `catch_warnings`.)

COMMENT:
i can work on sklearn/tests/test_naive_bayes.py

Labels: good first issue, module:test-suite, Meta-issue
Visualizations examples in documentation don't work

### Describe the issue linked to the documentation

The examples at https://scikit-learn.org/stable/visualizations.html don't work as shown.  Both produce error messages and no graphics.

### Suggest a potential alternative/fix

Modify documentation examples so they work.

COMMENT:
The docs on stable are for the latest stable version, which is currently 1.0. 

Can you verify that you are on 1.0? If not, upgrading to 1.0 should work.

Labels: Documentation
Visualizations examples in documentation don't work

### Describe the issue linked to the documentation

The examples at https://scikit-learn.org/stable/visualizations.html don't work as shown.  Both produce error messages and no graphics.

### Suggest a potential alternative/fix

Modify documentation examples so they work.

COMMENT:
Thanks for the clarification. Are you interested in opening a PR to add `load_wine`?

**Edit**: Now that we have the `plot` directive, we can plot directly in the [rst file](https://github.com/scikit-learn/scikit-learn/blob/5c7dac0131eb2318ccd4afad1e2e646e7b83b5ff/doc/visualizations.rst?plain=1#L23-L26):

```rst
.. plot::

    from sklearn.model_selection import train_test_split
    from sklearn.svm import SVC
    from sklearn.metrics import RocCurveDisplay
    from sklearn.datasets import load_wine

    X, y = load_wine(return_X_y=True)
    y = y == 2  # make binary
    X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)
    svc = SVC(random_state=42)
    svc.fit(X_train, y_train)

    svc_disp = RocCurveDisplay.from_estimator(svc, X_test, y_test)
```

and remove the `.. figure::` link to the gallery. This way, we can actually run the code and catch errors.

Labels: Documentation
Visualizations examples in documentation don't work

### Describe the issue linked to the documentation

The examples at https://scikit-learn.org/stable/visualizations.html don't work as shown.  Both produce error messages and no graphics.

### Suggest a potential alternative/fix

Modify documentation examples so they work.

COMMENT:
Even after specifying `X, y` and making `y` binary, there are still problems with the second example (`RandomForestClassifier`).  Have a look at the plot.

Labels: Documentation