Talip7/scikit-learn-issues-multilabel huggingface dataset:
page on the website that provides direction to users on how to reach out

from @amueller 
>Hey! Is there a page on the website that summarizes how to reach out and how we prefer people reach out? So far I only see collections of links. I kind of expected the "community" menu item to tell me how to engage with the community, but it currently links to the blog.

>The most concise summary seems to be in https://scikit-learn.org/dev/faq.html#what-s-the-best-way-to-get-help-on-scikit-learn-usage but it's not really the right question and it's a hard place to find, and outdated.

---
Copying text from Discord

This Discord server is intended for communication between the scikit-learn maintainers and community contributors during **Office Hours** and **Sprints**. If you have questions, this is our general workflow:

* **GitHub Discussions** 
     (usage questions such as methodological):  
     https://github.com/scikit-learn/scikit-learn/discussions
* **Stack Overflow**
     (programming questions):
     with tag ‘scikit-learn’
* **GitHub Issue Tracker**
     (bug reports): 
     https://github.com/scikit-learn/scikit-learn/issues
     Please do not ask usage questions on the issue tracker.
* **Discord server**
     (current pull requests):
     Please post any specific PR-related questions on your PR, and you can share a link to your PR on this server during office hours.

Reference on asking questions:
http://matthewrocklin.com/blog/2019/02/28/slack-github

**Calendar **for Office Hours:
https://blog.scikit-learn.org/calendar/

COMMENT:
> > hi , is this issue still open ? . if yes then i am ready to help you
> 
> Hi @ryuusama09 a pull request is already open. Feel free to pick any other [good first issue](https://github.com/scikit-learn/scikit-learn/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) to start contributing.

Hi @cmarmo, could you add a link to the pull request? :)

Labels: Easy, Documentation
page on the website that provides direction to users on how to reach out

from @amueller 
>Hey! Is there a page on the website that summarizes how to reach out and how we prefer people reach out? So far I only see collections of links. I kind of expected the "community" menu item to tell me how to engage with the community, but it currently links to the blog.

>The most concise summary seems to be in https://scikit-learn.org/dev/faq.html#what-s-the-best-way-to-get-help-on-scikit-learn-usage but it's not really the right question and it's a hard place to find, and outdated.

---
Copying text from Discord

This Discord server is intended for communication between the scikit-learn maintainers and community contributors during **Office Hours** and **Sprints**. If you have questions, this is our general workflow:

* **GitHub Discussions** 
     (usage questions such as methodological):  
     https://github.com/scikit-learn/scikit-learn/discussions
* **Stack Overflow**
     (programming questions):
     with tag ‘scikit-learn’
* **GitHub Issue Tracker**
     (bug reports): 
     https://github.com/scikit-learn/scikit-learn/issues
     Please do not ask usage questions on the issue tracker.
* **Discord server**
     (current pull requests):
     Please post any specific PR-related questions on your PR, and you can share a link to your PR on this server during office hours.

Reference on asking questions:
http://matthewrocklin.com/blog/2019/02/28/slack-github

**Calendar **for Office Hours:
https://blog.scikit-learn.org/calendar/

COMMENT:
> could you add a link to the pull request? :)

here it is : #24034 .

Labels: Easy, Documentation
page on the website that provides direction to users on how to reach out

from @amueller 
>Hey! Is there a page on the website that summarizes how to reach out and how we prefer people reach out? So far I only see collections of links. I kind of expected the "community" menu item to tell me how to engage with the community, but it currently links to the blog.

>The most concise summary seems to be in https://scikit-learn.org/dev/faq.html#what-s-the-best-way-to-get-help-on-scikit-learn-usage but it's not really the right question and it's a hard place to find, and outdated.

---
Copying text from Discord

This Discord server is intended for communication between the scikit-learn maintainers and community contributors during **Office Hours** and **Sprints**. If you have questions, this is our general workflow:

* **GitHub Discussions** 
     (usage questions such as methodological):  
     https://github.com/scikit-learn/scikit-learn/discussions
* **Stack Overflow**
     (programming questions):
     with tag ‘scikit-learn’
* **GitHub Issue Tracker**
     (bug reports): 
     https://github.com/scikit-learn/scikit-learn/issues
     Please do not ask usage questions on the issue tracker.
* **Discord server**
     (current pull requests):
     Please post any specific PR-related questions on your PR, and you can share a link to your PR on this server during office hours.

Reference on asking questions:
http://matthewrocklin.com/blog/2019/02/28/slack-github

**Calendar **for Office Hours:
https://blog.scikit-learn.org/calendar/

COMMENT:
hello can anybody please help or explain me with this . i can do it . i am a bit new to open source .

Labels: Easy, Documentation
Navigation on FAQ is not the best

### Describe the issue linked to the documentation

https://scikit-learn.org/dev/faq.html

The menu on the left is showing the full questions, which is hard to read.
The main page contains questions and answers so there's some scrolling.

### Suggest a potential alternative/fix

I think we should probably get rid of the content of the menu on the left since it doesn't help navigation.
If we want to introduce sections or something into the FAQ that might be useful there.

For the content page, I think we should either repeat all the questions at the top as links to the answers, or we should use some interactive widget that allows expanding the answers, so that someone can quickly see all the questions without having to scroll through all the answers.

COMMENT:
@amueller @thomasjpfan 
I wonder if there is a way to add categories (to the left navigation or somewhere else), rather than the full question.  Example:
- project name
- contributing
- adding new algorithms

Labels: Documentation
Navigation on FAQ is not the best

### Describe the issue linked to the documentation

https://scikit-learn.org/dev/faq.html

The menu on the left is showing the full questions, which is hard to read.
The main page contains questions and answers so there's some scrolling.

### Suggest a potential alternative/fix

I think we should probably get rid of the content of the menu on the left since it doesn't help navigation.
If we want to introduce sections or something into the FAQ that might be useful there.

For the content page, I think we should either repeat all the questions at the top as links to the answers, or we should use some interactive widget that allows expanding the answers, so that someone can quickly see all the questions without having to scroll through all the answers.

COMMENT:
I would like to work on this issue 🙋🏽‍♀️ 

I think the easiest way is to use [Dropdowns from sphinx-design](https://sphinx-design.readthedocs.io/en/latest/dropdowns.html) for each question, which would be an extension more. 

Then we can have the categories/sections as headers as @reshamas and @amueller suggested, so only they will be shown on the left.

Let me know if that sounds good to proceed.

Labels: Documentation
Navigation on FAQ is not the best

### Describe the issue linked to the documentation

https://scikit-learn.org/dev/faq.html

The menu on the left is showing the full questions, which is hard to read.
The main page contains questions and answers so there's some scrolling.

### Suggest a potential alternative/fix

I think we should probably get rid of the content of the menu on the left since it doesn't help navigation.
If we want to introduce sections or something into the FAQ that might be useful there.

For the content page, I think we should either repeat all the questions at the top as links to the answers, or we should use some interactive widget that allows expanding the answers, so that someone can quickly see all the questions without having to scroll through all the answers.

COMMENT:
I'm not convinced about the dropdown. For me, I link to the [inclusion criterion](https://scikit-learn.org/dev/faq.html#what-are-the-inclusion-criteria-for-new-algorithms) most often and adding another step for the contributor to get the information is not great to me.

As for sections, I'm okay with this idea if we can come up with section names for the FAQ items. For example, I think "adding new algorithms" would only contain one question.

I think a quick fix as suggested in https://github.com/scikit-learn/scikit-learn/issues/23839#issue-1294567893 is to add a TOC at the top of the page listing out the questions. A follow up PR would be to remove the sidebar questions.

Labels: Documentation
Navigation on FAQ is not the best

### Describe the issue linked to the documentation

https://scikit-learn.org/dev/faq.html

The menu on the left is showing the full questions, which is hard to read.
The main page contains questions and answers so there's some scrolling.

### Suggest a potential alternative/fix

I think we should probably get rid of the content of the menu on the left since it doesn't help navigation.
If we want to introduce sections or something into the FAQ that might be useful there.

For the content page, I think we should either repeat all the questions at the top as links to the answers, or we should use some interactive widget that allows expanding the answers, so that someone can quickly see all the questions without having to scroll through all the answers.

COMMENT:
Thanks @thomasjpfan and @reshamas for your comments. I opened the PR #24420 which includes the recommended changes. 3 generic categories were created to avoid categories with one or few questions.

Labels: Documentation
Navigation on FAQ is not the best

### Describe the issue linked to the documentation

https://scikit-learn.org/dev/faq.html

The menu on the left is showing the full questions, which is hard to read.
The main page contains questions and answers so there's some scrolling.

### Suggest a potential alternative/fix

I think we should probably get rid of the content of the menu on the left since it doesn't help navigation.
If we want to introduce sections or something into the FAQ that might be useful there.

For the content page, I think we should either repeat all the questions at the top as links to the answers, or we should use some interactive widget that allows expanding the answers, so that someone can quickly see all the questions without having to scroll through all the answers.

COMMENT:
Solved by @24420

Labels: Documentation
Navigation on FAQ is not the best

### Describe the issue linked to the documentation

https://scikit-learn.org/dev/faq.html

The menu on the left is showing the full questions, which is hard to read.
The main page contains questions and answers so there's some scrolling.

### Suggest a potential alternative/fix

I think we should probably get rid of the content of the menu on the left since it doesn't help navigation.
If we want to introduce sections or something into the FAQ that might be useful there.

For the content page, I think we should either repeat all the questions at the top as links to the answers, or we should use some interactive widget that allows expanding the answers, so that someone can quickly see all the questions without having to scroll through all the answers.

COMMENT:
Noticing the title of the issue, the navigation on our FAQ is now the _best_ lol

Labels: Documentation
Unclear selection of LOF threshold

In https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L103-L104 the documentation states that if the parameter 'contamination' is set to 'auto', the threshold for LOF will be calculated as outlined in the original paper.

But here https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L147-L148 and here https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L310  we can see that the threshold is set to 1.5 in all cases.
The original paper (https://doi.org/10.1145/335191.335388) never mentions the "magic number" 1.5, which makes me wonder where it comes from. 

I'd be glad if you could clarify this. If someone is able to provide a reference for the value of 1.5 I'll gladly update the documentation.

EDIT: The original paper mentions the number 1.5, but only in an example (Sec. 7.3). I don't think they meant to suggest that there is anything special about the number 1.5, it might even be possible that they settled on this number because of space constraints in the paper.

COMMENT:
Thank you for opening this issue.

@albertcthomas This seems to be added here: https://github.com/scikit-learn/scikit-learn/pull/9015. What do you think about this issue?

Labels: module:neighbors, Needs Investigation
Unclear selection of LOF threshold

In https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L103-L104 the documentation states that if the parameter 'contamination' is set to 'auto', the threshold for LOF will be calculated as outlined in the original paper.

But here https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L147-L148 and here https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L310  we can see that the threshold is set to 1.5 in all cases.
The original paper (https://doi.org/10.1145/335191.335388) never mentions the "magic number" 1.5, which makes me wonder where it comes from. 

I'd be glad if you could clarify this. If someone is able to provide a reference for the value of 1.5 I'll gladly update the documentation.

EDIT: The original paper mentions the number 1.5, but only in an example (Sec. 7.3). I don't think they meant to suggest that there is anything special about the number 1.5, it might even be possible that they settled on this number because of space constraints in the paper.

COMMENT:
It's mentioned in 7.3 and the reason is described in 7.1.

Arguments are a bit weak, IMO

Labels: module:neighbors, Needs Investigation
Unclear selection of LOF threshold

In https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L103-L104 the documentation states that if the parameter 'contamination' is set to 'auto', the threshold for LOF will be calculated as outlined in the original paper.

But here https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L147-L148 and here https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L310  we can see that the threshold is set to 1.5 in all cases.
The original paper (https://doi.org/10.1145/335191.335388) never mentions the "magic number" 1.5, which makes me wonder where it comes from. 

I'd be glad if you could clarify this. If someone is able to provide a reference for the value of 1.5 I'll gladly update the documentation.

EDIT: The original paper mentions the number 1.5, but only in an example (Sec. 7.3). I don't think they meant to suggest that there is anything special about the number 1.5, it might even be possible that they settled on this number because of space constraints in the paper.

COMMENT:
> It's mentioned in 7.3 

See my original post. In the paper, it is only used in one example.

> and the reason is described in 7.1.

Could you show me where exactly the reason for choosing the number 1.5 is described in Section 7.1? I can't find it.

Labels: module:neighbors, Needs Investigation
Unclear selection of LOF threshold

In https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L103-L104 the documentation states that if the parameter 'contamination' is set to 'auto', the threshold for LOF will be calculated as outlined in the original paper.

But here https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L147-L148 and here https://github.com/scikit-learn/scikit-learn/blob/baf0ea25d6dd034403370fea552b21a6776bef18/sklearn/neighbors/_lof.py#L310  we can see that the threshold is set to 1.5 in all cases.
The original paper (https://doi.org/10.1145/335191.335388) never mentions the "magic number" 1.5, which makes me wonder where it comes from. 

I'd be glad if you could clarify this. If someone is able to provide a reference for the value of 1.5 I'll gladly update the documentation.

EDIT: The original paper mentions the number 1.5, but only in an example (Sec. 7.3). I don't think they meant to suggest that there is anything special about the number 1.5, it might even be possible that they settled on this number because of space constraints in the paper.

COMMENT:
`We see that the objects in the uniform clusters
all have their LOF equal to 1. Most objects in the Gaussian clusters also have 1 as their LOF values. Slightly outside the Gaussian clusters, there are several weak outliers, i.e., those with relatively low,
but larger than 1, LOF values. The remaining seven objects all have
 significantly larger LOF values`.

They are stating that LOF threshold should be significantly higher than 1. In 7.2 they look at outliers that have scores (2, 2.4, 2.5, 2.8, 6) and in 7.3 they used 1.5 threshold.

This threshold could be set to legacy computation, I guess, if 1.5 is too confusing.

Labels: module:neighbors, Needs Investigation
KMeans not working with multiprocessing

TL;DR: it seems that kmeans need to somehow release processors after running, otherwise multiprocessing package cannot call it properly. 

I found this issue when I tried to build a multiprocessing tool that iteratively calls KMeans. It works fine if KMeans is only executed in the child processes. However, if the parent process executes KMeans, the child processes cannot execute KMeans anymore. To show this is the case, I did the test in 3 scenarios:
1) I only called KMeans in the child processes, and it worked fine;
2) I called KMeans in both the parent and the child processes, only the parent process would work and all child processes timed out;
3) I called KMeans by specifying the number of processors each time, then all processes would work. 

I have demonstrated it using a Notebook here:
https://colab.research.google.com/drive/1pO1TDIoZa1wmYPVar8FpaKJkEvLJDrk0?usp=sharing

COMMENT:
@jeremiedbb @ogrisel do you have an idea of what could go wrong with the interaction between `multiprocessing` and some inner `openmp` thingy?

Labels: Bug, Needs Investigation
KMeans not working with multiprocessing

TL;DR: it seems that kmeans need to somehow release processors after running, otherwise multiprocessing package cannot call it properly. 

I found this issue when I tried to build a multiprocessing tool that iteratively calls KMeans. It works fine if KMeans is only executed in the child processes. However, if the parent process executes KMeans, the child processes cannot execute KMeans anymore. To show this is the case, I did the test in 3 scenarios:
1) I only called KMeans in the child processes, and it worked fine;
2) I called KMeans in both the parent and the child processes, only the parent process would work and all child processes timed out;
3) I called KMeans by specifying the number of processors each time, then all processes would work. 

I have demonstrated it using a Notebook here:
https://colab.research.google.com/drive/1pO1TDIoZa1wmYPVar8FpaKJkEvLJDrk0?usp=sharing

COMMENT:
The core reason is KMeans uses OpenMP, Python multiprocessing use fork (by default) and OpenMP (to be precise GNU OpenMP) is not fork-safe, see https://bisqwit.iki.fi/story/howto/openmp/#OpenmpAndFork or https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52303 for more details.

A simpler snippet that reproduces the issue (you get a TimeoutError):
```py
from joblib import Parallel, delayed

from sklearn.cluster import KMeans

def kmeans():
    return KMeans(n_clusters=2, random_state=0).fit([[1, 1], [2, 2]])

kmeans()

Parallel(n_jobs=2, backend='multiprocessing', timeout=1)(delayed(kmeans)() for _ in range(2))
```

Possible work-arounds:
- use joblib loky backend (which is the default joblib backend) which was written to be able to use OpenMP in scikit-learn
- control OpenMP number of threads with threadpoolctl as you did or with the OMP_NUM_THREADS variable
- use `multiprocessing.set_start_method('spawn')`

I am going to close this issue, since there is nothing much we can do in scikit-learn.

Labels: Bug, Needs Investigation
Add a LearningCurveSplitter to test sample efficiency

### Describe the workflow you want to enable

In applications of machine learning the error of the model typically follows a power law with the number of training examples. In the ML for material science and molecules community there is lots of interest in using such plots to asses model performance however as of yet there is no standard splitting tool to make such splits. A standard splitter would improve the reproducibility and uptake of such studies.

### Describe your proposed solution

A learning-curve splitter that returns a series of training sets of various sizes alongside a fixed test set. Kwargs would control whether the splitting size was logarithmic, how many splits, whether to take multiple splits for each training set size, etc

### Describe alternatives you've considered, if relevant

_No response_

### Additional context

![image](https://user-images.githubusercontent.com/26601751/176975465-1b36d087-6f17-4d06-a2e7-eb3ffcccc2a7.png)
This is an example of the type of plot used to compare models. https://www.nature.com/articles/s41467-020-18556-9

COMMENT:
Hi! I’d like to work on this issue as my first contribution. Please let me know if it’s open and if there are any guidelines I should follow.

Labels: New Feature, Needs Decision - Include Feature
Unexpected interaction between param validation and _get_tags in TweedieRegressor

Calling ``_get_tags`` on a ``TweedieRegressor`` with invalid value for the ``link`` or ``power`` parameter raises an error.
This is because the tag "requires_positive_y" is computed dynamically and depends on these 2 parameters.

It causes this CI failure https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=44142&view=logs&j=c8afde5f-ef70-5983-62e8-c6b665ad6161&t=7fc5d80c-d67c-560e-65a2-6822419a270a
which happened after merging https://github.com/scikit-learn/scikit-learn/pull/23682 which adds param validation for GLMs and https://github.com/scikit-learn/scikit-learn/pull/23765 which makes the common test for param validation rely on the tags.

It brings 2 questions:
- should _more_tags in Tweedie perform validation for these 2 parameters to raise an informative error, even if it's a validation before fit ?
- would it be fine to implement an alternative to https://github.com/scikit-learn/scikit-learn/pull/23765 that does not rely on the tags, a bit like @glemaitre's first implementation ?

cc/ @glemaitre @thomasjpfan

COMMENT:
I think it makes sense for `_get_tags` to fail if the `__init__` are not configured property. Currently, the tags assume that the `__init__` parameters are properly configured. Another example is:

https://github.com/scikit-learn/scikit-learn/blob/48096911e49fec5c41e3c49f1c2a7d0b65c44967/sklearn/impute/_base.py#L128-L129

where it doesn't make too much sense if `missing_values` is not a scalar.

As a quick fix, I'm okay to use @glemaitre's first solution to inspect the signature.

Labels: Bug, Validation