Talip7/scikit-learn-issues-multilabel huggingface dataset:
Update Twitter to X Throughout the Repository

### Describe the issue linked to the documentation

With the recent rebranding of Twitter to X, several references to **Twitter** in the `scikit-learn` repository need to be updated to reflect this change. This includes updating URLs and any textual references across multiple files.

### Suggest a potential alternative/fix

#### Proposed Changes

- Change all instances of "Twitter" to "X" in the following files:
  - `README.rst`
  - `doc/templates/index.html`
  - `doc/whats_new/contributors.rst`

- Update the links to point to the new URL: `https://x.com/scikit_learn`

#### Affected File(s)

- `README.rst`
- `doc/templates/index.html`
- `doc/whats_new/contributors.rst`

#### Additional Notes

This change is necessary to keep the repository up-to-date with the latest branding changes.

COMMENT:
@ogrisel Can you please check out the issue as well as the PR i have raised for it. I am ready to make any further changes if required.

Labels: Documentation, Needs Triage
Update Twitter to X Throughout the Repository

### Describe the issue linked to the documentation

With the recent rebranding of Twitter to X, several references to **Twitter** in the `scikit-learn` repository need to be updated to reflect this change. This includes updating URLs and any textual references across multiple files.

### Suggest a potential alternative/fix

#### Proposed Changes

- Change all instances of "Twitter" to "X" in the following files:
  - `README.rst`
  - `doc/templates/index.html`
  - `doc/whats_new/contributors.rst`

- Update the links to point to the new URL: `https://x.com/scikit_learn`

#### Affected File(s)

- `README.rst`
- `doc/templates/index.html`
- `doc/whats_new/contributors.rst`

#### Additional Notes

This change is necessary to keep the repository up-to-date with the latest branding changes.

COMMENT:
Thanks for the issue. But I don't think so. Closing as wontfix. I rather remove all mentions of our twitter account rather than to change it to what an egocentric billionaire thinks it should be called.

Labels: Documentation, Needs Triage
Update Twitter to X Throughout the Repository

### Describe the issue linked to the documentation

With the recent rebranding of Twitter to X, several references to **Twitter** in the `scikit-learn` repository need to be updated to reflect this change. This includes updating URLs and any textual references across multiple files.

### Suggest a potential alternative/fix

#### Proposed Changes

- Change all instances of "Twitter" to "X" in the following files:
  - `README.rst`
  - `doc/templates/index.html`
  - `doc/whats_new/contributors.rst`

- Update the links to point to the new URL: `https://x.com/scikit_learn`

#### Affected File(s)

- `README.rst`
- `doc/templates/index.html`
- `doc/whats_new/contributors.rst`

#### Additional Notes

This change is necessary to keep the repository up-to-date with the latest branding changes.

COMMENT:
@adrinjalali If you want that I can remove all instances of twitter account, shall I go ahead and raise a PR for it ?

Labels: Documentation, Needs Triage
Update Twitter to X Throughout the Repository

### Describe the issue linked to the documentation

With the recent rebranding of Twitter to X, several references to **Twitter** in the `scikit-learn` repository need to be updated to reflect this change. This includes updating URLs and any textual references across multiple files.

### Suggest a potential alternative/fix

#### Proposed Changes

- Change all instances of "Twitter" to "X" in the following files:
  - `README.rst`
  - `doc/templates/index.html`
  - `doc/whats_new/contributors.rst`

- Update the links to point to the new URL: `https://x.com/scikit_learn`

#### Affected File(s)

- `README.rst`
- `doc/templates/index.html`
- `doc/whats_new/contributors.rst`

#### Additional Notes

This change is necessary to keep the repository up-to-date with the latest branding changes.

COMMENT:
Thanks @Demon-Sheriff , but I think we rather just keep it as is, since we cross post our social posts there. But thanks for looking into it 😊

Labels: Documentation, Needs Triage
Update Twitter to X Throughout the Repository

### Describe the issue linked to the documentation

With the recent rebranding of Twitter to X, several references to **Twitter** in the `scikit-learn` repository need to be updated to reflect this change. This includes updating URLs and any textual references across multiple files.

### Suggest a potential alternative/fix

#### Proposed Changes

- Change all instances of "Twitter" to "X" in the following files:
  - `README.rst`
  - `doc/templates/index.html`
  - `doc/whats_new/contributors.rst`

- Update the links to point to the new URL: `https://x.com/scikit_learn`

#### Affected File(s)

- `README.rst`
- `doc/templates/index.html`
- `doc/whats_new/contributors.rst`

#### Additional Notes

This change is necessary to keep the repository up-to-date with the latest branding changes.

COMMENT:
> Thanks @Demon-Sheriff , but I think we rather just keep it as is, since we cross post our social posts there. But thanks for looking into it 😊

@adrinjalali No problem, I would love to contribute to other issues in the repo. :smile:

Labels: Documentation, Needs Triage
Update Twitter to X Throughout the Repository

### Describe the issue linked to the documentation

With the recent rebranding of Twitter to X, several references to **Twitter** in the `scikit-learn` repository need to be updated to reflect this change. This includes updating URLs and any textual references across multiple files.

### Suggest a potential alternative/fix

#### Proposed Changes

- Change all instances of "Twitter" to "X" in the following files:
  - `README.rst`
  - `doc/templates/index.html`
  - `doc/whats_new/contributors.rst`

- Update the links to point to the new URL: `https://x.com/scikit_learn`

#### Affected File(s)

- `README.rst`
- `doc/templates/index.html`
- `doc/whats_new/contributors.rst`

#### Additional Notes

This change is necessary to keep the repository up-to-date with the latest branding changes.

COMMENT:
You might find #26927 interesting to start with :)

Labels: Documentation, Needs Triage
Update Twitter to X Throughout the Repository

### Describe the issue linked to the documentation

With the recent rebranding of Twitter to X, several references to **Twitter** in the `scikit-learn` repository need to be updated to reflect this change. This includes updating URLs and any textual references across multiple files.

### Suggest a potential alternative/fix

#### Proposed Changes

- Change all instances of "Twitter" to "X" in the following files:
  - `README.rst`
  - `doc/templates/index.html`
  - `doc/whats_new/contributors.rst`

- Update the links to point to the new URL: `https://x.com/scikit_learn`

#### Affected File(s)

- `README.rst`
- `doc/templates/index.html`
- `doc/whats_new/contributors.rst`

#### Additional Notes

This change is necessary to keep the repository up-to-date with the latest branding changes.

COMMENT:
@adrinjalali On it. :grin:

Labels: Documentation, Needs Triage
⚠️ CI failed on Linux_Runs.pylatest_conda_forge_mkl (last failure: Aug 09, 2024) ⚠️

**CI failed on [Linux_Runs.pylatest_conda_forge_mkl](https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=69335&view=logs&j=dde5042c-7464-5d47-9507-31bdd2ee0a3a)** (Aug 09, 2024)
- Test Collection Failure

COMMENT:
## CI is no longer failing! ✅

[Successful run](https://dev.azure.com/scikit-learn/scikit-learn/_build/results?buildId=69367&view=logs&j=dde5042c-7464-5d47-9507-31bdd2ee0a3a) on Aug 12, 2024

Labels: Needs Triage
BinMapper within HGBT does not handle sample weights

### Describe the bug

BinMapper under _hist_gradient_boosting does not accept sample weights as input leading to mismatch of bin thresholds outputted when calculating weighted versus repeated samples. Linked to Issue #27117

### Steps/Code to Reproduce

```python
from sklearn.ensemble._hist_gradient_boosting import binning

from sklearn.datasets import make_regression
import numpy as np

n_samples = 50  
n_features = 2
rng = np.random.RandomState(42)
    
X, y = make_regression(
    n_samples=n_samples,
    n_features=n_features,
    n_informative=n_features,
    random_state=0,
)

# Create dataset with repetitions and corresponding sample weights
sample_weight = rng.randint(0, 10, size=X.shape[0])
X_resampled_by_weights = np.repeat(X, sample_weight, axis=0)

bins_fit_weighted = binning._BinMapper(255).fit(X)
bins_fit_resampled = binning._BinMapper(255).fit(X_resampled_by_weights)

np.testing.assert_allclose(bins_fit_resampled.bin_thresholds_, bins_fit_weighted.bin_thresholds_)
```

### Expected Results

No error thrown

### Actual Results

```
AssertionError: 
Not equal to tolerance rtol=1e-07, atol=0

(shapes (2, 47), (2, 49) mismatch)
 ACTUAL: array([[-2.12963 , -1.668234, -1.622048, -1.433347, -1.208973, -1.117951,
        -1.059653, -0.977926, -0.901382, -0.891626, -0.879291, -0.841972,
        -0.742803, -0.653391, -0.572564, -0.510229, -0.456415, -0.395252,...
 DESIRED: array([[-2.12963 , -1.668234, -1.622048, -1.433347, -1.208973, -1.117951,
        -1.059653, -0.977926, -0.901382, -0.891626, -0.879291, -0.841972,
        -0.742803, -0.653391, -0.572564, -0.510229, -0.456415, -0.395252,...
```

### Versions

```shell
System:
    python: 3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:13:44) [Clang 16.0.6 ]
executable: /Users/shrutinath/micromamba/envs/scikit-learn/bin/python
   machine: macOS-14.3-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 24.0
   setuptools: 70.1.1
        numpy: 2.0.0
        scipy: 1.14.0
       Cython: 3.0.10
       pandas: None
   matplotlib: 3.9.0
       joblib: 1.4.2
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
...
    num_threads: 8
         prefix: libomp
       filepath: /Users/shrutinath/micromamba/envs/scikit-learn/lib/libomp.dylib
        version: None
```

COMMENT:
Closing as duplicate of #27117

Labels: Bug, Needs Triage
BinMapper within HGBT does not handle sample weights

### Describe the bug

BinMapper under _hist_gradient_boosting does not accept sample weights as input leading to mismatch of bin thresholds outputted when calculating weighted versus repeated samples. Linked to Issue #27117

### Steps/Code to Reproduce

```python
from sklearn.ensemble._hist_gradient_boosting import binning

from sklearn.datasets import make_regression
import numpy as np

n_samples = 50  
n_features = 2
rng = np.random.RandomState(42)
    
X, y = make_regression(
    n_samples=n_samples,
    n_features=n_features,
    n_informative=n_features,
    random_state=0,
)

# Create dataset with repetitions and corresponding sample weights
sample_weight = rng.randint(0, 10, size=X.shape[0])
X_resampled_by_weights = np.repeat(X, sample_weight, axis=0)

bins_fit_weighted = binning._BinMapper(255).fit(X)
bins_fit_resampled = binning._BinMapper(255).fit(X_resampled_by_weights)

np.testing.assert_allclose(bins_fit_resampled.bin_thresholds_, bins_fit_weighted.bin_thresholds_)
```

### Expected Results

No error thrown

### Actual Results

```
AssertionError: 
Not equal to tolerance rtol=1e-07, atol=0

(shapes (2, 47), (2, 49) mismatch)
 ACTUAL: array([[-2.12963 , -1.668234, -1.622048, -1.433347, -1.208973, -1.117951,
        -1.059653, -0.977926, -0.901382, -0.891626, -0.879291, -0.841972,
        -0.742803, -0.653391, -0.572564, -0.510229, -0.456415, -0.395252,...
 DESIRED: array([[-2.12963 , -1.668234, -1.622048, -1.433347, -1.208973, -1.117951,
        -1.059653, -0.977926, -0.901382, -0.891626, -0.879291, -0.841972,
        -0.742803, -0.653391, -0.572564, -0.510229, -0.456415, -0.395252,...
```

### Versions

```shell
System:
    python: 3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:13:44) [Clang 16.0.6 ]
executable: /Users/shrutinath/micromamba/envs/scikit-learn/bin/python
   machine: macOS-14.3-arm64-arm-64bit

Python dependencies:
      sklearn: 1.6.dev0
          pip: 24.0
   setuptools: 70.1.1
        numpy: 2.0.0
        scipy: 1.14.0
       Cython: 3.0.10
       pandas: None
   matplotlib: 3.9.0
       joblib: 1.4.2
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
    num_threads: 8
         prefix: libopenblas
...
    num_threads: 8
         prefix: libomp
       filepath: /Users/shrutinath/micromamba/envs/scikit-learn/lib/libomp.dylib
        version: None
```

COMMENT:
Thanks for the minimal reproducer though.

As discussed with Adrin, before merging a fix for the binmapper alone, we need to make sure that we also have a fix for the sample weight handling at the estimator level. But it's also true that that is easier to find in test the fixes for the subproblems in isolation if there are several fixes needed to get it to work at the estimator level.

So +1 for writing a unit test (and a fix) for the bin mapper in isolation but we should not merge the bin mapper fix in isolation.

Labels: Bug, Needs Triage
Maintenance releases for 1.1.x and 1.2.x with numpy < 2.0?

### Describe the workflow you want to enable

Having an environment file or requirement file with scikit-learn=1.1 or scikit-learn=1.2 will break, since neither supports numpy 2.0 but doesn't declare that.
Example:

```bash
$ conda create -n sklearn_numpy_test python=3.9
$ conda activate sklearn_numpy_test
$ pip install scikit-learn==1.1
$ python -c "import sklearn.linear_model"
```
> ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

### Describe your proposed solution

We could do patch release for those two releases that add a numpy < 2.0 requirement to the setup.py. This is not something we've done historically much, I think, but it's not ideal if old requirement files break. If someone pinned the patch release, adding a patch release with a fix won't help, unfortunately.

COMMENT:
Added to small PRs with cherry-picks of https://github.com/scikit-learn/scikit-learn/commit/02254cd8f3bb4d17d7cbeb920be8275c4d52d18a which on a cursory look seems to be what prevents this issue with the 1.3.X release branch for instance.

Labels: New Feature
Maintenance releases for 1.1.x and 1.2.x with numpy < 2.0?

### Describe the workflow you want to enable

Having an environment file or requirement file with scikit-learn=1.1 or scikit-learn=1.2 will break, since neither supports numpy 2.0 but doesn't declare that.
Example:

```bash
$ conda create -n sklearn_numpy_test python=3.9
$ conda activate sklearn_numpy_test
$ pip install scikit-learn==1.1
$ python -c "import sklearn.linear_model"
```
> ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

### Describe your proposed solution

We could do patch release for those two releases that add a numpy < 2.0 requirement to the setup.py. This is not something we've done historically much, I think, but it's not ideal if old requirement files break. If someone pinned the patch release, adding a patch release with a fix won't help, unfortunately.

COMMENT:
I don't remember where we discussed it, but I think we discussed this as part of the Numpy 2.0 release. The conclusion was to not do this. Maybe because we considered them too old?

I think for conda-forge we (aka the conda-forge maintainers) can/have made a repodata patch to retroactively add this constraint.

For me it is Ok to make patch releases. What do others think?

Labels: New Feature
Maintenance releases for 1.1.x and 1.2.x with numpy < 2.0?

### Describe the workflow you want to enable

Having an environment file or requirement file with scikit-learn=1.1 or scikit-learn=1.2 will break, since neither supports numpy 2.0 but doesn't declare that.
Example:

```bash
$ conda create -n sklearn_numpy_test python=3.9
$ conda activate sklearn_numpy_test
$ pip install scikit-learn==1.1
$ python -c "import sklearn.linear_model"
```
> ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

### Describe your proposed solution

We could do patch release for those two releases that add a numpy < 2.0 requirement to the setup.py. This is not something we've done historically much, I think, but it's not ideal if old requirement files break. If someone pinned the patch release, adding a patch release with a fix won't help, unfortunately.

COMMENT:
Sounds good to me as well.

Labels: New Feature
Maintenance releases for 1.1.x and 1.2.x with numpy < 2.0?

### Describe the workflow you want to enable

Having an environment file or requirement file with scikit-learn=1.1 or scikit-learn=1.2 will break, since neither supports numpy 2.0 but doesn't declare that.
Example:

```bash
$ conda create -n sklearn_numpy_test python=3.9
$ conda activate sklearn_numpy_test
$ pip install scikit-learn==1.1
$ python -c "import sklearn.linear_model"
```
> ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

### Describe your proposed solution

We could do patch release for those two releases that add a numpy < 2.0 requirement to the setup.py. This is not something we've done historically much, I think, but it's not ideal if old requirement files break. If someone pinned the patch release, adding a patch release with a fix won't help, unfortunately.

COMMENT:
Logistically, there are several work items to do a patch release:

- Cython version needs an upper bound. (I feel like we should pin Cython on release branches)
- CI linting failures. (CI uses the latest version of linters that can failure)
- Wheel building still works: Biggest difference is that macOS wheels were build on CirrusCI on 1.1.X and 1.2.X
- Tests may fail because they pull in the latest versions of packages (scipy, pandas) which may not be compatible with the old scikit-learn version.

Labels: New Feature
Maintenance releases for 1.1.x and 1.2.x with numpy < 2.0?

### Describe the workflow you want to enable

Having an environment file or requirement file with scikit-learn=1.1 or scikit-learn=1.2 will break, since neither supports numpy 2.0 but doesn't declare that.
Example:

```bash
$ conda create -n sklearn_numpy_test python=3.9
$ conda activate sklearn_numpy_test
$ pip install scikit-learn==1.1
$ python -c "import sklearn.linear_model"
```
> ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

### Describe your proposed solution

We could do patch release for those two releases that add a numpy < 2.0 requirement to the setup.py. This is not something we've done historically much, I think, but it's not ideal if old requirement files break. If someone pinned the patch release, adding a patch release with a fix won't help, unfortunately.

COMMENT:
Personally I would say this is not worth it.

This is likely a lot more work than we think because the CI in old releases has not been used for a while (so very likely broken in a way) and we will likely bump into complications. Also CI stuff tend to take longer than anticipated most of the times :wink:.

I would rather try to make the solution more easily findable, so here is the Numpy FAQ about this:
https://numpy.org/doc/stable/user/troubleshooting-importerror.html#downstream-importerror-attributeerror-or-c-api-abi-incompatibility

And for a bit of fun fact, at EuroScipy we were told by Sebastian that Numpy tried to surface a more user-friendly error message, except that there is a Cython check that happens earlier and is the cryptic one :sweat:

Labels: New Feature
Maintenance releases for 1.1.x and 1.2.x with numpy < 2.0?

### Describe the workflow you want to enable

Having an environment file or requirement file with scikit-learn=1.1 or scikit-learn=1.2 will break, since neither supports numpy 2.0 but doesn't declare that.
Example:

```bash
$ conda create -n sklearn_numpy_test python=3.9
$ conda activate sklearn_numpy_test
$ pip install scikit-learn==1.1
$ python -c "import sklearn.linear_model"
```
> ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

### Describe your proposed solution

We could do patch release for those two releases that add a numpy < 2.0 requirement to the setup.py. This is not something we've done historically much, I think, but it's not ideal if old requirement files break. If someone pinned the patch release, adding a patch release with a fix won't help, unfortunately.

COMMENT:
Understandable if it's considered too much work - I won't have the time to help with it. It will mean that anyone that wants to reproduce a result from a particular window will have to edit their environment file. The conda forge fix might be be useful if it's not too much work.

Labels: New Feature
Maintenance releases for 1.1.x and 1.2.x with numpy < 2.0?

### Describe the workflow you want to enable

Having an environment file or requirement file with scikit-learn=1.1 or scikit-learn=1.2 will break, since neither supports numpy 2.0 but doesn't declare that.
Example:

```bash
$ conda create -n sklearn_numpy_test python=3.9
$ conda activate sklearn_numpy_test
$ pip install scikit-learn==1.1
$ python -c "import sklearn.linear_model"
```
> ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

### Describe your proposed solution

We could do patch release for those two releases that add a numpy < 2.0 requirement to the setup.py. This is not something we've done historically much, I think, but it's not ideal if old requirement files break. If someone pinned the patch release, adding a patch release with a fix won't help, unfortunately.

COMMENT:
> The conda forge fix might be be useful if it's not too much work.

conda-forge already knows about which scikit-learn versions need `numpy<2` it seems (not sure how this happened and whether scikit-learn maintainers were involved ...).

For example this installs numpy 1.26:
```
conda create -n testenv scikit-learn=1.2
```

And trying to force numpy 2 gives an error:
```
❯ conda create -n testenv scikit-learn=1.2 'numpy>=2' -y
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed

LibMambaUnsatisfiableError: Encountered problems while solving:
  - nothing provides _numpy_rc needed by numpy-2.1.0rc1-py310hf9f9071_0

Could not solve for environment specs
The following packages are incompatible
├─ numpy >=2  is installable with the potential options
│  ├─ numpy [2.0.0|2.0.1|2.0.2|2.1.0|2.1.1], which can be installed;
│  ├─ numpy [2.1.0|2.1.1] would require
│  │  └─ python >=3.13.0rc1,<3.14.0a0 , which requires
│  │     └─ _python_rc, which does not exist (perhaps a missing channel);
│  └─ numpy 2.1.0rc1 would require
│     └─ _numpy_rc, which does not exist (perhaps a missing channel);
└─ scikit-learn 1.2**  is not installable because there are no viable options
   ├─ scikit-learn [1.2.0|1.2.1|1.2.2] would require
   │  └─ numpy >=1.21.6,<2.0a0 , which conflicts with any installable versions previously reported;
   ├─ scikit-learn [1.2.0|1.2.1|1.2.2] would require
   │  └─ numpy >=1.23.5,<2.0a0 , which conflicts with any installable versions previously reported;
   └─ scikit-learn [1.2.0|1.2.1|1.2.2] would require
      └─ numpy >=1.20.3,<2.0a0 , which conflicts with any installable versions previously reported.
```

Labels: New Feature