Talip7/scikit-learn-issues-multilabel huggingface dataset:
`UserWarning`s in the documentation

### Describe the issue linked to the documentation

Some `UserWarning` are present in the `dev` documentation and need to be fixed.
Here is a list:

 - [x] [gaussian_process/plot_gpr_prior_posterior.html](https://scikit-learn.org/dev/auto_examples/gaussian_process/plot_gpr_prior_posterior.html) #29380
 - [x] [model_selection/plot_cv_indices.html](https://scikit-learn.org/dev/auto_examples/model_selection/plot_cv_indices.html) #29072
 - [x] [linear_model/plot_sgd_iris.html](https://scikit-learn.org/dev/auto_examples/linear_model/plot_sgd_iris.html) #29121
 - [x] [linear_model/plot_logistic_multinomial.html](https://scikit-learn.org/dev/auto_examples/linear_model/plot_logistic_multinomial.html) #29120
 - [x] [tree/plot_iris_dtc.html](https://scikit-learn.org/dev/auto_examples/tree/plot_iris_dtc.html) #29109
 - [x] [svm/plot_svm_margin.html](https://scikit-learn.org/dev/auto_examples/svm/plot_svm_margin.html) #29187
 - [x] [ensemble/plot_adaboost_twoclass.html](https://scikit-learn.org/dev/auto_examples/ensemble/plot_adaboost_twoclass.html) #29188

Contributors willing to address this issue, please fix one example per pull request. It is ok to fix other warnings or errors in a given example.

Thanks for your help!

### Suggest a potential alternative/fix

_No response_

COMMENT:
working on plot_gpr_prior_posterior.html again

Labels: Documentation, good first issue, help wanted, Meta-issue
`UserWarning`s in the documentation

### Describe the issue linked to the documentation

Some `UserWarning` are present in the `dev` documentation and need to be fixed.
Here is a list:

 - [x] [gaussian_process/plot_gpr_prior_posterior.html](https://scikit-learn.org/dev/auto_examples/gaussian_process/plot_gpr_prior_posterior.html) #29380
 - [x] [model_selection/plot_cv_indices.html](https://scikit-learn.org/dev/auto_examples/model_selection/plot_cv_indices.html) #29072
 - [x] [linear_model/plot_sgd_iris.html](https://scikit-learn.org/dev/auto_examples/linear_model/plot_sgd_iris.html) #29121
 - [x] [linear_model/plot_logistic_multinomial.html](https://scikit-learn.org/dev/auto_examples/linear_model/plot_logistic_multinomial.html) #29120
 - [x] [tree/plot_iris_dtc.html](https://scikit-learn.org/dev/auto_examples/tree/plot_iris_dtc.html) #29109
 - [x] [svm/plot_svm_margin.html](https://scikit-learn.org/dev/auto_examples/svm/plot_svm_margin.html) #29187
 - [x] [ensemble/plot_adaboost_twoclass.html](https://scikit-learn.org/dev/auto_examples/ensemble/plot_adaboost_twoclass.html) #29188

Contributors willing to address this issue, please fix one example per pull request. It is ok to fix other warnings or errors in a given example.

Thanks for your help!

### Suggest a potential alternative/fix

_No response_

COMMENT:
Thanks to everyone who contributed on this issue :tada:

Labels: Documentation, good first issue, help wanted, Meta-issue
It's really amazing!! Why are the calculation results of the AUC (recall, precision) function and the average precision score function significantly different?

### Describe the bug

Method 1:
Precision, recall, _=Precision-Recall_curve()
A=auc (recall, precision)
Method 2:
B=average precision score ()
Method 1 and Method 2 both calculate the area under the PR curve, but why are the results significantly different, i.e. a ≠ b

### Steps/Code to Reproduce

Method 1:
Precision, recall, _=Precision-Recall_curve()
A=auc (recall, precision)
Method 2:
B=average precision score ()
Method 1 and Method 2 both calculate the area under the PR curve, but why are the results significantly different, i.e. A ≠ B

### Expected Results

A =  B

### Actual Results

A ≠ B

### Versions

```shell
sklearn: 1.0.2
```

COMMENT:
AUC uses the trapezoidal rule for interpolation between the points. The average precision score utilizes an interpolation scheme that can be described as a step function. Therefore the difference. For more information, see the user guide: https://scikit-learn.org/stable/modules/model_evaluation.html#precision-recall-and-f-measures .

Labels: Bug, Needs Triage
It's really amazing!! Why are the calculation results of the AUC (recall, precision) function and the average precision score function significantly different?

### Describe the bug

Method 1:
Precision, recall, _=Precision-Recall_curve()
A=auc (recall, precision)
Method 2:
B=average precision score ()
Method 1 and Method 2 both calculate the area under the PR curve, but why are the results significantly different, i.e. a ≠ b

### Steps/Code to Reproduce

Method 1:
Precision, recall, _=Precision-Recall_curve()
A=auc (recall, precision)
Method 2:
B=average precision score ()
Method 1 and Method 2 both calculate the area under the PR curve, but why are the results significantly different, i.e. A ≠ B

### Expected Results

A =  B

### Actual Results

A ≠ B

### Versions

```shell
sklearn: 1.0.2
```

COMMENT:
Indeed this is linked with the following comment:

> The average precision (cf. [average_precision_score](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.average_precision_score.html#sklearn.metrics.average_precision_score)) in scikit-learn is computed without any interpolation. To be consistent with this metric, the precision-recall curve is plotted without any interpolation as well (step-wise style).

> You can change this style by passing the keyword argument drawstyle="default". However, the curve will not be strictly consistent with the reported average precision.

The computation of average precision is therefore not trivial :)

Labels: Bug, Needs Triage
Make `zero_division` parameter consistent in the different metric

This is an issue to report the step to actually take over the work of @marctorsoc in https://github.com/scikit-learn/scikit-learn/pull/23183 and split the PR into smaller one to facilitate the review process.

The intend is to make the `zero_division` parameter consistent across different metrics in scikit-learn. In this regards, we have the following TODO list:

- [x] Introduce the `zero_division` parameter to the `accuracy_score` function when `y_true` and `y_pred` are empty.
    - https://github.com/scikit-learn/scikit-learn/pull/29213
- [x] Introduce the `zero_division` parameter to the `class_likelihood_ratios` and remove `raise_warning`.
    - https://github.com/scikit-learn/scikit-learn/pull/31331
- [x] Introduce the `zero_division` parameter to the `cohen_kappa_score` function
  - https://github.com/scikit-learn/scikit-learn/pull/29210
- [x] Introduce the `zero_division` parameter to the `matthew_corr_coeff` function
  - #23183
  - #28509
- [ ] <del>Open a PR to make sure the empty input lead to `np.nan` in `classification_report` function.</del> `classification_report` should raise an error instead: see https://github.com/scikit-learn/scikit-learn/issues/29048#issuecomment-2857931743

All those items have been addressed in #23183 and can be extracted in individual PRs. The changelog presenting the changes should acknowledge @marctorsoc.

In addition, we should investigate #27047 and check if we should add the `zero_division` parameter to the `precision_recall_curve` and `roc_curve` as well. This might add two additional items to the list above.

COMMENT:
@StefanieSenger you might be interested in looking at some of the item.

Labels: Enhancement
Make `zero_division` parameter consistent in the different metric

This is an issue to report the step to actually take over the work of @marctorsoc in https://github.com/scikit-learn/scikit-learn/pull/23183 and split the PR into smaller one to facilitate the review process.

The intend is to make the `zero_division` parameter consistent across different metrics in scikit-learn. In this regards, we have the following TODO list:

- [x] Introduce the `zero_division` parameter to the `accuracy_score` function when `y_true` and `y_pred` are empty.
    - https://github.com/scikit-learn/scikit-learn/pull/29213
- [x] Introduce the `zero_division` parameter to the `class_likelihood_ratios` and remove `raise_warning`.
    - https://github.com/scikit-learn/scikit-learn/pull/31331
- [x] Introduce the `zero_division` parameter to the `cohen_kappa_score` function
  - https://github.com/scikit-learn/scikit-learn/pull/29210
- [x] Introduce the `zero_division` parameter to the `matthew_corr_coeff` function
  - #23183
  - #28509
- [ ] <del>Open a PR to make sure the empty input lead to `np.nan` in `classification_report` function.</del> `classification_report` should raise an error instead: see https://github.com/scikit-learn/scikit-learn/issues/29048#issuecomment-2857931743

All those items have been addressed in #23183 and can be extracted in individual PRs. The changelog presenting the changes should acknowledge @marctorsoc.

In addition, we should investigate #27047 and check if we should add the `zero_division` parameter to the `precision_recall_curve` and `roc_curve` as well. This might add two additional items to the list above.

COMMENT:
+1 for this!

Labels: Enhancement
Make `zero_division` parameter consistent in the different metric

This is an issue to report the step to actually take over the work of @marctorsoc in https://github.com/scikit-learn/scikit-learn/pull/23183 and split the PR into smaller one to facilitate the review process.

The intend is to make the `zero_division` parameter consistent across different metrics in scikit-learn. In this regards, we have the following TODO list:

- [x] Introduce the `zero_division` parameter to the `accuracy_score` function when `y_true` and `y_pred` are empty.
    - https://github.com/scikit-learn/scikit-learn/pull/29213
- [x] Introduce the `zero_division` parameter to the `class_likelihood_ratios` and remove `raise_warning`.
    - https://github.com/scikit-learn/scikit-learn/pull/31331
- [x] Introduce the `zero_division` parameter to the `cohen_kappa_score` function
  - https://github.com/scikit-learn/scikit-learn/pull/29210
- [x] Introduce the `zero_division` parameter to the `matthew_corr_coeff` function
  - #23183
  - #28509
- [ ] <del>Open a PR to make sure the empty input lead to `np.nan` in `classification_report` function.</del> `classification_report` should raise an error instead: see https://github.com/scikit-learn/scikit-learn/issues/29048#issuecomment-2857931743

All those items have been addressed in #23183 and can be extracted in individual PRs. The changelog presenting the changes should acknowledge @marctorsoc.

In addition, we should investigate #27047 and check if we should add the `zero_division` parameter to the `precision_recall_curve` and `roc_curve` as well. This might add two additional items to the list above.

COMMENT:
I am working on task-1 (Introduce the zero_division parameter to the accuracy_score function when y_true and y_pred are empty.).

Labels: Enhancement
Make `zero_division` parameter consistent in the different metric

This is an issue to report the step to actually take over the work of @marctorsoc in https://github.com/scikit-learn/scikit-learn/pull/23183 and split the PR into smaller one to facilitate the review process.

The intend is to make the `zero_division` parameter consistent across different metrics in scikit-learn. In this regards, we have the following TODO list:

- [x] Introduce the `zero_division` parameter to the `accuracy_score` function when `y_true` and `y_pred` are empty.
    - https://github.com/scikit-learn/scikit-learn/pull/29213
- [x] Introduce the `zero_division` parameter to the `class_likelihood_ratios` and remove `raise_warning`.
    - https://github.com/scikit-learn/scikit-learn/pull/31331
- [x] Introduce the `zero_division` parameter to the `cohen_kappa_score` function
  - https://github.com/scikit-learn/scikit-learn/pull/29210
- [x] Introduce the `zero_division` parameter to the `matthew_corr_coeff` function
  - #23183
  - #28509
- [ ] <del>Open a PR to make sure the empty input lead to `np.nan` in `classification_report` function.</del> `classification_report` should raise an error instead: see https://github.com/scikit-learn/scikit-learn/issues/29048#issuecomment-2857931743

All those items have been addressed in #23183 and can be extracted in individual PRs. The changelog presenting the changes should acknowledge @marctorsoc.

In addition, we should investigate #27047 and check if we should add the `zero_division` parameter to the `precision_recall_curve` and `roc_curve` as well. This might add two additional items to the list above.

COMMENT:
Thank you @Jaimin020 ! I needed that recently and had to write a wrapper of the accuracy function.

Labels: Enhancement
Make `zero_division` parameter consistent in the different metric

This is an issue to report the step to actually take over the work of @marctorsoc in https://github.com/scikit-learn/scikit-learn/pull/23183 and split the PR into smaller one to facilitate the review process.

The intend is to make the `zero_division` parameter consistent across different metrics in scikit-learn. In this regards, we have the following TODO list:

- [x] Introduce the `zero_division` parameter to the `accuracy_score` function when `y_true` and `y_pred` are empty.
    - https://github.com/scikit-learn/scikit-learn/pull/29213
- [x] Introduce the `zero_division` parameter to the `class_likelihood_ratios` and remove `raise_warning`.
    - https://github.com/scikit-learn/scikit-learn/pull/31331
- [x] Introduce the `zero_division` parameter to the `cohen_kappa_score` function
  - https://github.com/scikit-learn/scikit-learn/pull/29210
- [x] Introduce the `zero_division` parameter to the `matthew_corr_coeff` function
  - #23183
  - #28509
- [ ] <del>Open a PR to make sure the empty input lead to `np.nan` in `classification_report` function.</del> `classification_report` should raise an error instead: see https://github.com/scikit-learn/scikit-learn/issues/29048#issuecomment-2857931743

All those items have been addressed in #23183 and can be extracted in individual PRs. The changelog presenting the changes should acknowledge @marctorsoc.

In addition, we should investigate #27047 and check if we should add the `zero_division` parameter to the `precision_recall_curve` and `roc_curve` as well. This might add two additional items to the list above.

COMMENT:
The intend of this issue is not quite clear to me. @glemaitre, could you clarify:

#23183 is about to be merged for the last 1,5 years, but is difficult to review. This issue is supposed to facilitate this process by splitting it into different pull-requests. However, it only lists tasks that would enhance the original PR (or add to it) and depend on it to be merged (except `matthew_corr_coeff` that had already been added to the old PR by your request). 

1) How would adding those new PRs help maintainers to decide about the original PR?
2) Would those new PRs also be mergable if the original PR was in the end not adopted?

I can also see that the communication on in the original PR has been very frustrating for its author, because it was unclear, what he needs to deliver in order to push the reviewing process forwards. We should at least define this very clearly right now. This will help everybody involved (and everybody who wants to get involved) know what to expect and be efficient.

Labels: Enhancement
Make `zero_division` parameter consistent in the different metric

This is an issue to report the step to actually take over the work of @marctorsoc in https://github.com/scikit-learn/scikit-learn/pull/23183 and split the PR into smaller one to facilitate the review process.

The intend is to make the `zero_division` parameter consistent across different metrics in scikit-learn. In this regards, we have the following TODO list:

- [x] Introduce the `zero_division` parameter to the `accuracy_score` function when `y_true` and `y_pred` are empty.
    - https://github.com/scikit-learn/scikit-learn/pull/29213
- [x] Introduce the `zero_division` parameter to the `class_likelihood_ratios` and remove `raise_warning`.
    - https://github.com/scikit-learn/scikit-learn/pull/31331
- [x] Introduce the `zero_division` parameter to the `cohen_kappa_score` function
  - https://github.com/scikit-learn/scikit-learn/pull/29210
- [x] Introduce the `zero_division` parameter to the `matthew_corr_coeff` function
  - #23183
  - #28509
- [ ] <del>Open a PR to make sure the empty input lead to `np.nan` in `classification_report` function.</del> `classification_report` should raise an error instead: see https://github.com/scikit-learn/scikit-learn/issues/29048#issuecomment-2857931743

All those items have been addressed in #23183 and can be extracted in individual PRs. The changelog presenting the changes should acknowledge @marctorsoc.

In addition, we should investigate #27047 and check if we should add the `zero_division` parameter to the `precision_recall_curve` and `roc_curve` as well. This might add two additional items to the list above.

COMMENT:
I realised that the solution lies in first [splitting up the original PR](https://github.com/scikit-learn/scikit-learn/pull/23183#issuecomment-1411118385) as proposed by the author.

After that, the other tasks from the task list above can be tackled.

I will open PRs that split up the original PR during the next days.

Labels: Enhancement
Make `zero_division` parameter consistent in the different metric

This is an issue to report the step to actually take over the work of @marctorsoc in https://github.com/scikit-learn/scikit-learn/pull/23183 and split the PR into smaller one to facilitate the review process.

The intend is to make the `zero_division` parameter consistent across different metrics in scikit-learn. In this regards, we have the following TODO list:

- [x] Introduce the `zero_division` parameter to the `accuracy_score` function when `y_true` and `y_pred` are empty.
    - https://github.com/scikit-learn/scikit-learn/pull/29213
- [x] Introduce the `zero_division` parameter to the `class_likelihood_ratios` and remove `raise_warning`.
    - https://github.com/scikit-learn/scikit-learn/pull/31331
- [x] Introduce the `zero_division` parameter to the `cohen_kappa_score` function
  - https://github.com/scikit-learn/scikit-learn/pull/29210
- [x] Introduce the `zero_division` parameter to the `matthew_corr_coeff` function
  - #23183
  - #28509
- [ ] <del>Open a PR to make sure the empty input lead to `np.nan` in `classification_report` function.</del> `classification_report` should raise an error instead: see https://github.com/scikit-learn/scikit-learn/issues/29048#issuecomment-2857931743

All those items have been addressed in #23183 and can be extracted in individual PRs. The changelog presenting the changes should acknowledge @marctorsoc.

In addition, we should investigate #27047 and check if we should add the `zero_division` parameter to the `precision_recall_curve` and `roc_curve` as well. This might add two additional items to the list above.

COMMENT:
> I realised that the solution lies in first https://github.com/scikit-learn/scikit-learn/pull/23183#issuecomment-1411118385 as proposed by the author.

Exactly.

> I will open PRs that split up the original PR during the next days.

Do not hesitate to tackle a single PR first such that we make sure to get reviews.

Labels: Enhancement
Make `zero_division` parameter consistent in the different metric

This is an issue to report the step to actually take over the work of @marctorsoc in https://github.com/scikit-learn/scikit-learn/pull/23183 and split the PR into smaller one to facilitate the review process.

The intend is to make the `zero_division` parameter consistent across different metrics in scikit-learn. In this regards, we have the following TODO list:

- [x] Introduce the `zero_division` parameter to the `accuracy_score` function when `y_true` and `y_pred` are empty.
    - https://github.com/scikit-learn/scikit-learn/pull/29213
- [x] Introduce the `zero_division` parameter to the `class_likelihood_ratios` and remove `raise_warning`.
    - https://github.com/scikit-learn/scikit-learn/pull/31331
- [x] Introduce the `zero_division` parameter to the `cohen_kappa_score` function
  - https://github.com/scikit-learn/scikit-learn/pull/29210
- [x] Introduce the `zero_division` parameter to the `matthew_corr_coeff` function
  - #23183
  - #28509
- [ ] <del>Open a PR to make sure the empty input lead to `np.nan` in `classification_report` function.</del> `classification_report` should raise an error instead: see https://github.com/scikit-learn/scikit-learn/issues/29048#issuecomment-2857931743

All those items have been addressed in #23183 and can be extracted in individual PRs. The changelog presenting the changes should acknowledge @marctorsoc.

In addition, we should investigate #27047 and check if we should add the `zero_division` parameter to the `precision_recall_curve` and `roc_curve` as well. This might add two additional items to the list above.

COMMENT:
> Do not hesitate to tackle a single PR first such that we make sure to get reviews.

~~Good point. So I will start with this: "PR to add zero_division=np.nan to precision, recall, f1, fbeta_score, precision_recall_fscore_support and classification_report"~~ (Edit: This was already done.)

I had missed the fact that the original PR had already mostly been adopted by #25531 and the remaining tasks are actually only those listed in the issue above. The original PR had now been closed by the author to avoid confusion (mine :rofl: ).

I will take care of the inividual PR for the `cohen_kappa_score` function.

Labels: Enhancement
Make `zero_division` parameter consistent in the different metric

This is an issue to report the step to actually take over the work of @marctorsoc in https://github.com/scikit-learn/scikit-learn/pull/23183 and split the PR into smaller one to facilitate the review process.

The intend is to make the `zero_division` parameter consistent across different metrics in scikit-learn. In this regards, we have the following TODO list:

- [x] Introduce the `zero_division` parameter to the `accuracy_score` function when `y_true` and `y_pred` are empty.
    - https://github.com/scikit-learn/scikit-learn/pull/29213
- [x] Introduce the `zero_division` parameter to the `class_likelihood_ratios` and remove `raise_warning`.
    - https://github.com/scikit-learn/scikit-learn/pull/31331
- [x] Introduce the `zero_division` parameter to the `cohen_kappa_score` function
  - https://github.com/scikit-learn/scikit-learn/pull/29210
- [x] Introduce the `zero_division` parameter to the `matthew_corr_coeff` function
  - #23183
  - #28509
- [ ] <del>Open a PR to make sure the empty input lead to `np.nan` in `classification_report` function.</del> `classification_report` should raise an error instead: see https://github.com/scikit-learn/scikit-learn/issues/29048#issuecomment-2857931743

All those items have been addressed in #23183 and can be extracted in individual PRs. The changelog presenting the changes should acknowledge @marctorsoc.

In addition, we should investigate #27047 and check if we should add the `zero_division` parameter to the `precision_recall_curve` and `roc_curve` as well. This might add two additional items to the list above.

COMMENT:
I have created a pull request for task-1 (https://github.com/scikit-learn/scikit-learn/pull/29213), but the 'codecov/patch' check is failing. Could someone please review it and advise me on how to pass this check?

Labels: Enhancement