Talip7/scikit-learn-issues-multilabel huggingface dataset:
GridSearchCV support for 'precomputed' kernel not documented

### Describe the issue linked to the documentation

GridSearchCV seems to work even with a precomputed kernel but there is nothing about it in the documentation. Is there a reason for this or did it just go unnoticed?

### Suggest a potential alternative/fix

Add documentation to the fit function of the class that it accepts a precomputed square matrix of shape (n_samples, n_samples).

COMMENT:
Hi @jeremiedbb,

I made the PR: #29586

Labels: Documentation
CI Investigate timeout in no-OpenMP build with Meson 1.5

https://github.com/scikit-learn/scikit-learn/pull/29486#issuecomment-2242359516

> So the no-OpenMP build still times out ... from the [diff](https://github.com/scikit-learn/scikit-learn/pull/29486/files#diff-5dfc3d97f64b11902494f92b685545d78f4aa020b235c55db0d2d4a87bb976fe) Meson 1.5 could be the culprit maybe 🤔 ...
> 
> One thing that is weird is that OpenMP is now detected in the no-OpenMP build, so at the very least this build does not serve its purpose and needs to be adapted. Probably this as a side-effect of [mesonbuild/meson#13350](https://github.com/mesonbuild/meson/pull/13350), see see [build log](https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=68941&view=logs&j=e6d5b7c0-0dfd-5ddf-13d5-c71bebf56ce2&t=c500742d-7cbe-569e-8da5-94db9b4cd21e&l=43)
> 
> ```
> Built with OpenMP: True
> ```

Once this is fixed/worked-around, the temporary Meson<1.5 pin can be removed:
https://github.com/scikit-learn/scikit-learn/blob/8133ecaacca77f06a8c4c560f5dbbfd654f1990f/build_tools/update_environments_and_lock_files.py#L168-L170

COMMENT:
> EDIT: all tests finished with the only failure being checking if OpenMP is enabled. This test can be skipped by setting the SKLEARN_SKIP_OPENMP_TEST environment variable to any value.

Yep this is expected indeed see https://github.com/scikit-learn/scikit-learn/issues/29603#issuecomment-2262920019.

As for fixing this is the CI what I would try:
- Add `brew uninstall libomp` after this line: https://github.com/scikit-learn/scikit-learn/blob/45cf8ec555a026c4263e8bef12850755a83df10e/build_tools/azure/install.sh#L119
- remove these lines https://github.com/scikit-learn/scikit-learn/blob/45cf8ec555a026c4263e8bef12850755a83df10e/build_tools/update_environments_and_lock_files.py#L168-L170
- Update no-OpenMP lock-file locally, run `python build_tools/update_environments_and_lock_files.py --select-build no_openmp`
- open a PR with your local files and see whether the CI agrees with this plan, tweak the plan to make the CI happy otherwise

I guess @StefanieSenger has done it recently in #29434 so she can probably help if needed and I can definitely help if you get stuck.

Labels: Build / CI
"Choosing the right estimator"-widget links broken

### Describe the bug

The links in the helper graph (think it's called machine learning map) to guide choosing an estimator (link: https://scikit-learn.org/stable/machine_learning_map.html#ml-map) is broken - the links are not up-to-date to reflect the url-structure in terms of branch: stable or development.

The links in the graph are e.g. https://scikit-learn.org/modules/clustering.html#mean-shift (for MeanShift) where it should be https://scikit-learn.org/branch/modules/clustering.html#mean-shift (where **branch** can be either **stable** or **dev**).

So instead of linking to the correct page, depending on whether the user is looking at the stable or development documentation, the user is met with a github pages 404 error.

### Steps/Code to Reproduce

Navigate to https://scikit-learn.org/stable/machine_learning_map.html#ml-map or https://scikit-learn.org/dev/machine_learning_map.html#ml-map and see the map. Click on any of the bubbles in the map and be greeted with a 404-page-not-found-error.

### Expected Results

Correct page should be shown.

### Actual Results

404-error is shown instead.

### Versions

```shell
stable (currently 1.5) and dev (currently 1.6)
```

COMMENT:
Seems to be because the page was moved up one level when we removed the tutorials thus breaking the relative links. I will make a fix soon. Thanks for the report @arighauks!

Labels: Documentation
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
This _might_ be related to #27993 , although it is more so related to multi-task random forests

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
Hi @adam2392 ,

If you could help me, I have some questions about this Issue.

1. Is this Issue still open, and is it worth working on it? I followed the history associated, and it seems that the first conversations about it started 10 years ago.

2. Do you think this is "easy enough" to be a good "second issue?" Because my first and only contribution was a few weeks ago. @glemaitre cc here just because your [comment](https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2242817769) on a related Issue. Also, I would like a "second opinion" on this question.

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
Hi @vitorpohlenz !

Thank you for your interest in contributing! 

1. Yes it is still open and it is worth working on it. 
2. Is it easy? That depends on your experience with Cython and/or C++ and also understanding of decision trees. It also depends on how deep you want to dive into the code. The main thing to add is the same tree logic handling for missing values for sparse array inputs. 

Lmk what you think and if you have a proposed idea of how to proceed.

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
> Hi [@vitorpohlenz](https://github.com/vitorpohlenz) !
> 
> Thank you for your interest in contributing!
> 
> 1. Yes it is still open and it is worth working on it.
> 2. Is it easy? That depends on your experience with Cython and/or C++ and also understanding of decision trees. It also depends on how deep you want to dive into the code. The main thing to add is the same tree logic handling for missing values for sparse array inputs.
> 
> Lmk what you think and if you have a proposed idea of how to proceed.

Thanks for replying @adam2392 !

About [2.] I have no previous experience with Cython, and just a little experience with C++ (I have worked a little with C, but it was 10 years ago). But I understand the theory of decision trees. I know about the CART algorithm and the ways to measure the impurity using metrics like entropy, gini, etc...

So, I would like to ask your opinion if you think it is a good idea for me to work on this issue(based on your expertise and this piece of information), to get more acquainted with the tree-based code in sklearn. 

Also, if I could ask for some guidance/advice to not struggle too much, if necessary

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
Hi @vitorpohlenz 

> So, I would like to ask your opinion if you think it is a good idea for me to work on this issue(based on your expertise and this piece of information), to get more acquainted with the tree-based code in sklearn.

Cython / C++ knowledge is definitely needed within the scikit-learn dev/reviewer community, so anyone interested is definitely welcome! There will be a learning curve, and require you to explore how Cython works, and what doesn't work. I think it's a net-positive to your skillset.

With that being said, yes you can ask for guidance / advice, but note my time is a bit limited these days, so will definitely require a lot of self-learning.

As a first step, I would look at this PR: https://github.com/scikit-learn/scikit-learn/pull/27966, review how Cython works. Then what's needed is for one to:

1. understand how sparse arrays work
2. understand how missing-values are split in the sklearn RF algo
3. apply that understanding to the sparse splitter logic

Feel free to propose/iterate on this plan accordingly!

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
Hi @adam2392, thanks a lot for replying!

> With that being said, yes you can ask for guidance / advice, but note my time is a bit limited these days, so will definitely require a lot of self-learning.

Sure, I understand that this task will be more self-driven than based on external aid. But this kind of guidance, like you did, will help me a lot.

So I will /take it and will start by the steps you suggested, and will update the progress here until I have a clear proposal of enhancement.

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
Update about the progress/steps that I'm doing:
- [x] Understanding how sparse arrays work
- [x] Understanding how missing values are split in the sklearn Random Forest algorithm
- [x] Define how to apply the modifications to the sparse splitter logic

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
@adam2392  Hi! I noticed this issue has been inactive for a while. I'd love to take it on. Let me know if it's okay for me to proceed and open a PR. Thanks!

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
Sure if @vitorpohlenz is not taking this on any more? Let's wait and see what they say first. 

Another comment: this is probably challenging, but an impactful issue. Are you familiar or willing to spend time learning about Cython to add this feature?

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
Hi @adam2392 and @rusdes, thanks for asking!

Yes, I am still following the "steps of learning" to implement this feature. 
Right now, I'm halfway through "Understanding how missing values are split in the sklearn Random Forest algorithm".
I intend to keep on it until I finish, as you said @adam2392 it takes some time to learn all, mostly because I just have my "free time" for it. 
But if you think I'm taking too long to finish, I can take another Issue to work on. Despite that, from my side, I intend to finish, even if it takes time, I think it would be a good learning path.

Labels: help wanted, module:tree, cython
FEA Add missing-value support to sparse splitter in RandomForest and ExtraTrees

### Summary
While missing-value support for decision trees have been added recently, they only work when encoded in a dense array. Since `RandomForest*` and `ExtraTrees*` both support sparse `X`, if a user encodes `np.nan` inside sparse `X`, it should still work.

### Solution
Add missing-value logic in `SparsePartitioner` in `_parititoner.pyx`, `BestSparseSplitter` and `RandomSparseSplitter` in `_splitter.pyx`.

The logic is the same as in the dense case, but just has to handle the fact that `X` is now sparse CSC array format.

### Misc.
              FYI https://github.com/scikit-learn/scikit-learn/pull/27966 will introduce native support for missing values in the `ExtraTree*` models (i.e. random splitter). 

One thing I noticed though as I went through the PR is that the current codebase still does not support missing values in the sparse splitter. I think this might be pretty easy to add, but should we re-open this issue technically?

Xref: https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-1166581736

_Originally posted by @adam2392 in https://github.com/scikit-learn/scikit-learn/issues/5870#issuecomment-2212688552_

COMMENT:
Okay in that case I do want to be fair to @vitorpohlenz. I propose @vitorpohlenz continue with the issue unless @rusdes you had an implementation in mind? 

Otw feel free to check back in periodically (e.g. once a month). 

Lmk if anything I overlooked. 

Thanks!

Labels: help wanted, module:tree, cython