Talip7/scikit-learn-issues-multilabel huggingface dataset:
`IterativeImputer` skip iterative part if `keep_empty_features` is set to `True`

### Describe the bug

The mask is set to all True, so that the iterative imputation will be skipped.

https://github.com/scikit-learn/scikit-learn/blob/a4ebe19a95ffbb3cf6abf3e98d737d0d097f5de3/sklearn/impute/_iterative.py#L649-L651

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

imp = IterativeImputer(keep_empty_features=True)
X = [[np.nan, 0, 1], [2, np.nan, 3], [4, 5, np.nan]]
print(imp.fit_transform(X))
print(imp.imputation_sequence_)
```

### Expected Results

Should act the same as `keep_empty_features=False`

### Actual Results

```
# transformed X
[[3.  0.  1. ]
 [2.  2.5 3. ]
 [4.  5.  2. ]]

# imputation_sequence_
[]
```

### Versions

```shell
System:
    python: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)  [Clang 14.0.6 ]
executable: /Users/xxf/miniconda3/envs/sklearn-env/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 23.2.1
   setuptools: 68.0.0
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: 3.0.8
       pandas: 2.1.0
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libopenblas.0.dylib
        version: 0.3.23
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libomp.dylib
        version: None
```

COMMENT:
/take

Labels: Bug
`IterativeImputer` skip iterative part if `keep_empty_features` is set to `True`

### Describe the bug

The mask is set to all True, so that the iterative imputation will be skipped.

https://github.com/scikit-learn/scikit-learn/blob/a4ebe19a95ffbb3cf6abf3e98d737d0d097f5de3/sklearn/impute/_iterative.py#L649-L651

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

imp = IterativeImputer(keep_empty_features=True)
X = [[np.nan, 0, 1], [2, np.nan, 3], [4, 5, np.nan]]
print(imp.fit_transform(X))
print(imp.imputation_sequence_)
```

### Expected Results

Should act the same as `keep_empty_features=False`

### Actual Results

```
# transformed X
[[3.  0.  1. ]
 [2.  2.5 3. ]
 [4.  5.  2. ]]

# imputation_sequence_
[]
```

### Versions

```shell
System:
    python: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)  [Clang 14.0.6 ]
executable: /Users/xxf/miniconda3/envs/sklearn-env/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 23.2.1
   setuptools: 68.0.0
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: 3.0.8
       pandas: 2.1.0
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libopenblas.0.dylib
        version: 0.3.23
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libomp.dylib
        version: None
```

COMMENT:
@Anurag-Varma I think the output should be the same as `keep_empty_features=False`.

Labels: Bug
`IterativeImputer` skip iterative part if `keep_empty_features` is set to `True`

### Describe the bug

The mask is set to all True, so that the iterative imputation will be skipped.

https://github.com/scikit-learn/scikit-learn/blob/a4ebe19a95ffbb3cf6abf3e98d737d0d097f5de3/sklearn/impute/_iterative.py#L649-L651

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

imp = IterativeImputer(keep_empty_features=True)
X = [[np.nan, 0, 1], [2, np.nan, 3], [4, 5, np.nan]]
print(imp.fit_transform(X))
print(imp.imputation_sequence_)
```

### Expected Results

Should act the same as `keep_empty_features=False`

### Actual Results

```
# transformed X
[[3.  0.  1. ]
 [2.  2.5 3. ]
 [4.  5.  2. ]]

# imputation_sequence_
[]
```

### Versions

```shell
System:
    python: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)  [Clang 14.0.6 ]
executable: /Users/xxf/miniconda3/envs/sklearn-env/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 23.2.1
   setuptools: 68.0.0
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: 3.0.8
       pandas: 2.1.0
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libopenblas.0.dylib
        version: 0.3.23
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libomp.dylib
        version: None
```

COMMENT:
@xuefeng-xu I think it's working as required

[keep_empty_featuresbool, default=False](https://scikit-learn.org/stable/modules/generated/sklearn.impute.IterativeImputer.html#iterativeimputer)

```python
#Test this example

import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

# Example data with a feature that has all missing values
X = [[np.nan, 0, 1], [np.nan, 2, 3], [np.nan, 4, 5]]

imp = IterativeImputer(keep_empty_features=True)
X_imputed = imp.fit_transform(X)

print(X_imputed)
```


You can test this code for `keep_empty_features=` True and False

When True:
```
#Output is
[[0. 0. 1.]
 [0. 2. 3.]
 [0. 4. 5.]]
```

When False:
```
#Output is:
[[0. 1.]
 [2. 3.]
 [4. 5.]]
```

Labels: Bug
`IterativeImputer` skip iterative part if `keep_empty_features` is set to `True`

### Describe the bug

The mask is set to all True, so that the iterative imputation will be skipped.

https://github.com/scikit-learn/scikit-learn/blob/a4ebe19a95ffbb3cf6abf3e98d737d0d097f5de3/sklearn/impute/_iterative.py#L649-L651

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

imp = IterativeImputer(keep_empty_features=True)
X = [[np.nan, 0, 1], [2, np.nan, 3], [4, 5, np.nan]]
print(imp.fit_transform(X))
print(imp.imputation_sequence_)
```

### Expected Results

Should act the same as `keep_empty_features=False`

### Actual Results

```
# transformed X
[[3.  0.  1. ]
 [2.  2.5 3. ]
 [4.  5.  2. ]]

# imputation_sequence_
[]
```

### Versions

```shell
System:
    python: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)  [Clang 14.0.6 ]
executable: /Users/xxf/miniconda3/envs/sklearn-env/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 23.2.1
   setuptools: 68.0.0
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: 3.0.8
       pandas: 2.1.0
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libopenblas.0.dylib
        version: 0.3.23
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libomp.dylib
        version: None
```

COMMENT:
@Anurag-Varma For data you provided, there's no need to fit any estimater since it just need to discard the first column or replace it with zeros.

For the data sample I provided, do you think `IterativeImputer` should behave the same?

Labels: Bug
`IterativeImputer` skip iterative part if `keep_empty_features` is set to `True`

### Describe the bug

The mask is set to all True, so that the iterative imputation will be skipped.

https://github.com/scikit-learn/scikit-learn/blob/a4ebe19a95ffbb3cf6abf3e98d737d0d097f5de3/sklearn/impute/_iterative.py#L649-L651

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

imp = IterativeImputer(keep_empty_features=True)
X = [[np.nan, 0, 1], [2, np.nan, 3], [4, 5, np.nan]]
print(imp.fit_transform(X))
print(imp.imputation_sequence_)
```

### Expected Results

Should act the same as `keep_empty_features=False`

### Actual Results

```
# transformed X
[[3.  0.  1. ]
 [2.  2.5 3. ]
 [4.  5.  2. ]]

# imputation_sequence_
[]
```

### Versions

```shell
System:
    python: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)  [Clang 14.0.6 ]
executable: /Users/xxf/miniconda3/envs/sklearn-env/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 23.2.1
   setuptools: 68.0.0
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: 3.0.8
       pandas: 2.1.0
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libopenblas.0.dylib
        version: 0.3.23
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libomp.dylib
        version: None
```

COMMENT:
@xuefeng-xu I understand it now.

So incase [features that consist exclusively of missing values](https://scikit-learn.org/stable/modules/generated/sklearn.impute.IterativeImputer.html#iterativeimputer) then it will return 0 if its set True.

Incase of False, it removes that feature and the returned array size may vary. But if True then it returns the same size but with 0 in the example which i provided above.

But for your example, it's returning different output when its set to True.

I think, it should return the same output as when it was set to False.

Labels: Bug
`IterativeImputer` skip iterative part if `keep_empty_features` is set to `True`

### Describe the bug

The mask is set to all True, so that the iterative imputation will be skipped.

https://github.com/scikit-learn/scikit-learn/blob/a4ebe19a95ffbb3cf6abf3e98d737d0d097f5de3/sklearn/impute/_iterative.py#L649-L651

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

imp = IterativeImputer(keep_empty_features=True)
X = [[np.nan, 0, 1], [2, np.nan, 3], [4, 5, np.nan]]
print(imp.fit_transform(X))
print(imp.imputation_sequence_)
```

### Expected Results

Should act the same as `keep_empty_features=False`

### Actual Results

```
# transformed X
[[3.  0.  1. ]
 [2.  2.5 3. ]
 [4.  5.  2. ]]

# imputation_sequence_
[]
```

### Versions

```shell
System:
    python: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)  [Clang 14.0.6 ]
executable: /Users/xxf/miniconda3/envs/sklearn-env/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 23.2.1
   setuptools: 68.0.0
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: 3.0.8
       pandas: 2.1.0
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libopenblas.0.dylib
        version: 0.3.23
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libomp.dylib
        version: None
```

COMMENT:
@Anurag-Varma Thank you! I currently don't have time to fix this, if you want to do it, feel free to open a PR.

Labels: Bug
`IterativeImputer` skip iterative part if `keep_empty_features` is set to `True`

### Describe the bug

The mask is set to all True, so that the iterative imputation will be skipped.

https://github.com/scikit-learn/scikit-learn/blob/a4ebe19a95ffbb3cf6abf3e98d737d0d097f5de3/sklearn/impute/_iterative.py#L649-L651

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

imp = IterativeImputer(keep_empty_features=True)
X = [[np.nan, 0, 1], [2, np.nan, 3], [4, 5, np.nan]]
print(imp.fit_transform(X))
print(imp.imputation_sequence_)
```

### Expected Results

Should act the same as `keep_empty_features=False`

### Actual Results

```
# transformed X
[[3.  0.  1. ]
 [2.  2.5 3. ]
 [4.  5.  2. ]]

# imputation_sequence_
[]
```

### Versions

```shell
System:
    python: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)  [Clang 14.0.6 ]
executable: /Users/xxf/miniconda3/envs/sklearn-env/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 23.2.1
   setuptools: 68.0.0
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: 3.0.8
       pandas: 2.1.0
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libopenblas.0.dylib
        version: 0.3.23
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libomp.dylib
        version: None
```

COMMENT:
@xuefeng-xu Are you interested in taking this bug.

In the latest case which you provided, I am unable to make the required changes to make it work as I am a new contributer. And this has few complex changes to satisfy.

Labels: Bug
`IterativeImputer` skip iterative part if `keep_empty_features` is set to `True`

### Describe the bug

The mask is set to all True, so that the iterative imputation will be skipped.

https://github.com/scikit-learn/scikit-learn/blob/a4ebe19a95ffbb3cf6abf3e98d737d0d097f5de3/sklearn/impute/_iterative.py#L649-L651

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

imp = IterativeImputer(keep_empty_features=True)
X = [[np.nan, 0, 1], [2, np.nan, 3], [4, 5, np.nan]]
print(imp.fit_transform(X))
print(imp.imputation_sequence_)
```

### Expected Results

Should act the same as `keep_empty_features=False`

### Actual Results

```
# transformed X
[[3.  0.  1. ]
 [2.  2.5 3. ]
 [4.  5.  2. ]]

# imputation_sequence_
[]
```

### Versions

```shell
System:
    python: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)  [Clang 14.0.6 ]
executable: /Users/xxf/miniconda3/envs/sklearn-env/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 23.2.1
   setuptools: 68.0.0
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: 3.0.8
       pandas: 2.1.0
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libopenblas.0.dylib
        version: 0.3.23
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libomp.dylib
        version: None
```

COMMENT:
Hi @xuefeng-xu , I can reproduce the issues. Can I work on this issue?

Labels: Bug
`IterativeImputer` skip iterative part if `keep_empty_features` is set to `True`

### Describe the bug

The mask is set to all True, so that the iterative imputation will be skipped.

https://github.com/scikit-learn/scikit-learn/blob/a4ebe19a95ffbb3cf6abf3e98d737d0d097f5de3/sklearn/impute/_iterative.py#L649-L651

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer

imp = IterativeImputer(keep_empty_features=True)
X = [[np.nan, 0, 1], [2, np.nan, 3], [4, 5, np.nan]]
print(imp.fit_transform(X))
print(imp.imputation_sequence_)
```

### Expected Results

Should act the same as `keep_empty_features=False`

### Actual Results

```
# transformed X
[[3.  0.  1. ]
 [2.  2.5 3. ]
 [4.  5.  2. ]]

# imputation_sequence_
[]
```

### Versions

```shell
System:
    python: 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:38:11)  [Clang 14.0.6 ]
executable: /Users/xxf/miniconda3/envs/sklearn-env/bin/python
   machine: macOS-14.5-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 23.2.1
   setuptools: 68.0.0
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: 3.0.8
       pandas: 2.1.0
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libopenblas.0.dylib
        version: 0.3.23
threading_layer: openmp
   architecture: VORTEX

       user_api: openmp
   internal_api: openmp
    num_threads: 8
         prefix: libomp
       filepath: /Users/xxf/miniconda3/envs/sklearn-env/lib/libomp.dylib
        version: None
```

COMMENT:
Sure, go ahead @adrinjalali

Labels: Bug
Build failure under Termux: can not execute sklearn/_build_utils/version.py

### Describe the bug

When attempting to install the newest (and older) versions of scikit-learn-1.6.dev0 using regular pip install, the installation fails due to a missing version.py file. This issue occurs on an Android system using Termux.
Environment details:
OS: Linux localhost 4.14.186+ (Android)
Architecture: aarch64
Python: 3.11
The error occurs during the Meson build process, which tries to execute a non-existent file:
/data/data/com.termux/files/home/downloads/scikit-learn/sklearn/_build_utils/version.py
A workaround patch has been developed to address this issue:
```
#!/bin/bash

# Navigate to the scikit-learn directory, e.g.:
cd ~/downloads/scikit-learn

# Extract version from pyproject.toml and remove "dev" suffix
VERSION=$(grep 'version =' pyproject.toml | sed 's/version = "\(.*\)"/\1/' | sed 's/\.dev0//')

# Create the directory if it doesn't exist
mkdir -p sklearn/_build_utils

# Create the version.py file with the correct content
cat << EOF > sklearn/_build_utils/version.py
#!/usr/bin/env python
print('${VERSION}')
EOF

# Make the file executable
chmod +x sklearn/_build_utils/version.py

echo "Created sklearn/_build_utils/version.py with version ${VERSION}"
```
This patch:
- Extracts the version number from pyproject.toml
- Removes the "dev" suffix
- Creates the missing version.py file with a generic Python shebang
- Makes the file executable

After applying this patch, the Meson build process completes successfully, and the installation can proceed: 
```
cpu family: aarch64
Host machine cpu: aarch64
Compiler for C supports arguments -Wno-unused-but-set-variable: YE
Compiler for C supports arguments -Wno-unused-function: YES
Compiler for C supports arguments -Wno-conversion: YES
Compiler for C supports arguments -Wno-misleading-indentation: YES
Library m found: YES
Program python3 found: YES (/data/data/com.termux/files/usr/bin/python3.11)
Run-time dependency OpenMP for c found: YES 5.1
Found pkg-config: YES (/data/data/com.termux/files/usr/bin/pkg-config) 0.29.2
Run-time dependency python found: YES 3.11    Build targets in project: 111
Found ninja-1.11.1.git.kitware.jobserver-1 ...
```
and:
```
Successfully installed scikit-learn-1.6.dev0  ~/downloads/scikit-learn $
```

### Steps/Code to Reproduce

pip install -U -v scikit-learn

### Expected Results

.

### Actual Results

.

### Versions

```shell
scikit-learn-1.6.dev0, and older
```

COMMENT:
Hmmm this is weird, since `sklearn/_build_utils/version.py` is inside the git repository, see https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/_build_utils/version.py.

Can you explain how you download scikit-learn, i.e. how do you create `~/downloads/scikit-learn` folder and contents?

Labels: Build / CI, Low Priority